Set dynamic url in field via a business rule

clyon
Tera Guru

I have a business rule that calls a REST Service to create an Incident in another ServiceNow instance. Upon return I will have the newly created INC and INC sys_id.

I'm trying to set the url to that new INC in the u_incident_number field (type= url) and have the INC number displayed from within a related list.

I able to set the INC number, but the URL goes to the case table which is incorrect. How can I set the URL?

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

use something like this



var url="https://...........?uri=inicdent.do?sys_id="+parsedResponse.result.sys_id;


current.u_incident_number="<a href="+url+">"+parsedResponse.result.number+"</a>";


View solution in original post

14 REPLIES 14

Daryll Conway
Giga Guru

If your business rule is running on the case table then current will be a case record.


I think you need to change current for a gliderecord query to the table you require.


The business rule is running on the related table case_incidents. The data I   need updating is occuring in the correct place. I'm just in need to dynamically set the value of where the u_incident_number field links to and have it display number of the new INC.


Abhinay Erra
Giga Sage

Christina,



What is the field type of u_incident_number? If it is a reference type, what table is it referencing to?


find_real_file.png


It's not a reference field b/c what it references is in another instance.