location not getting pouplated in list viwew in request

KashikaJ
Tera Contributor

I have written a client script to populate the location is REQ form the location is getting populated in form view but the location is not getting populated in List view. How can this be fixed.

1 ACCEPTED SOLUTION

@KashikaJ 

please use before insert/update business rule on sc_request and don't use client script

BR Order: 10000

BR Condition: current.requested_for != ''

Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	current.location = current.requested_for.location;

})(current, previous);

Also ensure the location field on form is REQ own field and not dot walked field

OR Best Way

If customer only wants to see the Location on REQ then why not show Requested For->Location on form as dot walked field. This way no scripting is required.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

@KashikaJ 

please use before insert/update business rule on sc_request and don't use client script

BR Order: 10000

BR Condition: current.requested_for != ''

Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	current.location = current.requested_for.location;

})(current, previous);

Also ensure the location field on form is REQ own field and not dot walked field

OR Best Way

If customer only wants to see the Location on REQ then why not show Requested For->Location on form as dot walked field. This way no scripting is required.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Thanks for your help and support it helped me.

 

Regards,

Kashika

Glad to help

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader