Skip to content

Instantly share code, notes, and snippets.

@squarelabsgit
Created May 28, 2024 00:21
Show Gist options
  • Select an option

  • Save squarelabsgit/012e45f575c3faf5ab408818ce3d6aca to your computer and use it in GitHub Desktop.

Select an option

Save squarelabsgit/012e45f575c3faf5ab408818ce3d6aca to your computer and use it in GitHub Desktop.
Filter Supplier Contact (onBeforeUpdate)

Filter Supplier Contact (onBeforeUpdate)

//Get the New Supplier Account Selected before save
const supplierAccountName = value;
//Get the Supplier Contact Field Object
const supplierContactField = ZDK.Page.getField('Supplier_Contact');
//Check the Supplier Account Field is not empty
if (supplierAccountName) {
    //Add criteria to filter the lookup field
    supplierContactField.setCriteria("(Account_Name:equals:" + supplierAccountName + ")", {filterOnSearch: true});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment