[GF#10] How to manage reference qualifiers across multiple tables with one business rule

glideFather
Tera Patron

This is not a question. 

Context
During activation of the Normalization Data Services Client plugin (com.glide.data_services_canonicalization.client), I got to the Update Reference Qualifiers step in the corresponding guided setup. Completing that step wasn't possible and it ended up being skipped. 

glideFather_7-1786621029515.png

glideFather_8-1786621049616.png

glideFather_9-1786621080470.png

 

Why not manual updates

All these 2687 tables have one or more fields referencing values from the Company table [core_company], such as Company, Customer, Vendor, Support Vendor or Manufacturer

 

Some example tables:

  • cmdb_ci and extended ones
  • alm_asset
  • ast_contract
  • service_offering
  • task

Setting the reference qualifiers manually would be overkill and it also wouldn't automatically apply if a reference field is added to another table in the future.

 

Technical note

Don't be surprised: field labelled Normalized is actually named "canonical"

glideFather_0-1786624239561.png

 

Solution

With that in mind, my colleague Javi told me about a trick I wasn't aware of and I thought it was worth sharing here:

  • create display business rule on the referenced table (Company in this case),
  • write desired condition of your reference qualifier to the Script field (checkbox Advanced must be true)
  • it was an easy condition for this use case
    • display only records with value true in the Normalize (canonical) field
current.addQuery('canonical', true); 

 

glideFather_10-1786621199541.png

 

Validation

  1. Go to Company [core_company] table and mark down following numbers:
    • how many Company records are there in total,
    • how many of them have Normalized (canonical) set to true,
    • ensure there's at least one set to false,
  2. Navigate to a form that references the Company table
    • any of the tables mentioned above,
  3. Open the lookup icon of that field and compare it with the numbers from the step 1:
    • it must correspond with the total records marked as true,
    • records marked as false cannot be selectable in that reference field

 

Keywords

reference qualifier, display business rule, company, vendor, customer, manufacturer, normalization, canonical, guided setup

 

______

EDIT: formatting + typos correction


✂-----Cutting-out-the---✦AI-noise✦---All-replies-written-and-vouched-for-by-GlideFather---
0 REPLIES 0