- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 04:50 AM
Hi,
I have created a string field WOT number in the cmdb_ci_storage_device form and I have brought the related list storage device in the work order task, When I click on new in the storage device related list of the work order task form, the current number of the work order task must be populated in the WOT number field which is available in cmdb_ci_storage_device form. How can I do this?
Solved! Go to Solution.
- Labels:
-
Field Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 07:03 AM
Hi Vivek,
I would recommend using a reference field instead of string field; in that way the relationship would come automatically and the parent field would be set automatically
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
03-09-2020 07:29 AM
Hi Vivek,
as per your screenshot the WOT number shows an ref icon indicating some record information in it; can you check by clicking the 'i' icon what is shows
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
03-09-2020 07:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 09:18 AM
Thanks it worked now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2020 05:07 AM
Hi,
For getting this related WOT you should create a clientScript onLoad on the form that you are targeting and use scratchpad variables from Bussines rule, I give some example that I used:
// Business rule on display advanced
var sourceURL = gs.action.getGlideURI().getMap().get('sysparm_collection');
var aux= '';
if(sourceURL == "table_you_want"){
id = gs.action.getGlideURI().getMap().get('sysparm_collectionID');
g_scratchpad.wmTask = aux;
}
//Client script onLoad
function onLoad() {
if(g_form.isNewRecord()){
g_form.setValue('wot_referenced',g_scratchpad.wmTask);
}
}
If it was helpful, please give positive feedback.
Thanks,
☆ Community Rising Star 22, 23 & 24 ☆