Business Rule to populate the Field values From Another Field Through Reference Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 01:47 AM
Hai,
Need a help in creating business rule. I am new to service now .kindly help on this script.
I Have an Customer Field On the form ,I have taken Reference table in Customer Field, If I Select The Customer Field, Display the Customer Name field and Multiplier Field
I Was Trying This Script ,Using Business Rule.
var gt = new GlideRecord('u_ln_customers');
gt.addQuery('u_ln_customers', current.u_customer);
gt.query();
if('u_customerISNOTEMPTY');
{}
if(gt.next()){}
current.u_ln_customers_u_customer_name =gt.u_customer.u_cname;
current.u_ln_customers_u_multiplier = gt.u_customer.u_multiplier;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 01:54 AM
hello there. i believe the u_customer field from the form is a reference to the u_ln_customers.so you should be querying for the sys id of that table.
then in the script line number 4 replace the query as below
gt.addQuery('sys_id',current.u_customer);
please mark my answer correct and helpful it it helps you in anyway
Regards,
Thameem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 02:06 AM
Hai ,
Its Not Working,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 02:23 AM
Please answer the below questions.
1.does the current.u_customer field is a reference field of the u_ln_customers table
2.if yes the u_cname and u_multiplier field are available in the same u_ln_customers table or its from different table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 09:16 PM
hai ,
Yes both are available in same table,