Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to dot walk in Business rule

shaik_irfan
Tera Guru

Hello Everyone,

I want to populate a field name which is present on u_bsa table.

On u_bsa table i field named as Req for which was dot walk by sc_req_item table, i want to display that Req for field name for which i written a script like below

i am getting a display value as undefined

var ritm = new GlideRecord('u_bsa');

if(ritm.get(current.sysapproval)){

var req_for = ritm.u_requested_for.name;   //Output i am getting is undefined

var ge = ritm.u_requested_item.number; // I am getting correct output here

gs.addInfoMessage(req_for);

gs.addInfoMessage(ge);

1 ACCEPTED SOLUTION

Try



var req_for = ritm.u_requested_item.u_requested_for.getDisplayValue()



Manish


View solution in original post

16 REPLIES 16

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Is u_requested_for a reference field?


Yes its a Reference field which is actually a field of RITM table, i dot walk using form layout and i populated on u_bsa form.



find_real_file.png


Hamza Berouil2
Tera Guru

Hello Shaik,



Please provide more info :


- The type and the table de Business Rule (Approval ?)


- Why do you think the "u_bsa" is "current.sysappoval" ?


- Are sure do you enter the "if" statement. if yes, please make sure you use the correct syntax. else put a log meessage in the 'if' statement to make sure you're in



Can you try to print the sys_id of the "u_bsa" record (e.g.   gs.addInfoMessage(ritm.sys_id) ?


I can able to pring the sys_id of u_bsa table


Try



var req_for = ritm.u_requested_item.u_requested_for.getDisplayValue()



Manish