- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 10:08 PM
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 11:34 PM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 11:34 PM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2025 12:25 AM
Hi Ankur,
Thanks for your help and support it helped me.
Regards,
Kashika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2025 12:39 AM
Glad to help
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader