Skip to content

Instantly share code, notes, and snippets.

@squarelabsgit
Last active May 28, 2024 00:19
Show Gist options
  • Select an option

  • Save squarelabsgit/44643d1c1d216b60a3f1e35c57787e97 to your computer and use it in GitHub Desktop.

Select an option

Save squarelabsgit/44643d1c1d216b60a3f1e35c57787e97 to your computer and use it in GitHub Desktop.
Filter Supplier Contact

Filter Supplier Contact

//Get the Supplier Account & Supplier Contact Field Objects
const supplierAccountField = ZDK.Page.getField('Supplier_Account');
const supplierContactField = ZDK.Page.getField('Supplier_Contact');
//Check the Supplier Account Field is not empty
if (supplierAccountField.getValue()) {
    //Get the Name of the Supplier Account
    const supplierAccountName = supplierAccountField.getValue().name;
    //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