/
(2024.1) Prevent Duplicate Charge Catalog Entries

(2024.1) Prevent Duplicate Charge Catalog Entries

This Custom Logic is for a (2024.1) Custom Validation.

Prevent Duplicate Charge Catalogs
/** * Prevents duplicate name/type combinations in the CHRG_CATALOG table. * * Description: Prevent Duplicate CHRG_CATALOG Entries * Table Name: CHRG_CATALOG * Table Record: null * Action: Save */ $query = "SELECT RECID FROM CHRG_CATALOG WHERE NAME = '" . $params["charge_name"] . "' AND CHARGE_TYPE_LISTS_RECID = " . $params["type"]; $existing = $this->query($query); if (isset($existing[0]["RECID"]) && ($existing[0]["RECID"] !== $data["RECID"])) { $this->setMessage('Save failed: there already exists a Charge Catalog record with the same name/type combination'); return false; } return true;



Related content

(v1) Prevent Duplicate Charge Catalog Entries
(v1) Prevent Duplicate Charge Catalog Entries
More like this
(v1) .Prevent Duplicate Charge Catalog Entries v2021.3
(v1) .Prevent Duplicate Charge Catalog Entries v2021.3
More like this
(v1) .Custom Validation Library v2019.2
(v1) .Custom Validation Library v2019.2
More like this
(v1) .Custom Validation Library v2022.1
(v1) .Custom Validation Library v2022.1
More like this
(2024.1) Prevent Duplicate Equipment Catalog Entries
(2024.1) Prevent Duplicate Equipment Catalog Entries
More like this