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:55 AM
Hi,
try this since u_customer is already reference then no need to query
Directly dot walk and fetch the values
current.u_ln_customers_u_customer_name = current.u_customer.u_cname;
current.u_ln_customers_u_multiplier = current.u_customer.u_multiplier;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 02:07 AM
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 02:12 AM
Hi,
please share some more details
1) u_customer field is referring to which table
2) which table is having u_customer field? is it Special event?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 07:17 AM
Hai,
we have Taken reference tables as" u_ln_customers "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 09:28 PM
update as this
current.u_customer_name = current.u_customer.u_cname;
current.u_multiplier = current.u_customer.u_multiplier;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader