Document toolboxDocument toolbox

(2022.1) Service Orders Require Owner

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

Service Orders Require Owner
if ($data["RECID"] != "addNew" && $params['sd_type'] == 'sd-service-order' && 
    $data['SD_STATUS_LISTS_RECID'] == $this->listGetByCode('SD_STATUS', 'COMPLETE') &&
                empty($data['D_OWNER_CONTACTS_RECID']) &&
                empty($data['D_OWNER_DEPT_HIERARCHY_RECID'])
            ) {
  
                    $this->setMessage("An owner is required to complete the order. <br>" .
                                      "Please select an owner then save the record again.");
                                    return false;

            }
          //  return true;