- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 02:09 AM
Hi everyone!
I need this requirement where, when I select a value in "Service offering" field, I want to auto populate the "Service" field based the Parent field of the selected "Service offering"
Example below:
If "Service offering" = Offering v1 , then, "Offering" = SAP Enterprise Services
Hope you can help me out 🙂 Thank you in advance everyone!
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 02:34 AM
Hello,
Write a On change client script on service offering table:-
Use the below code:-
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var caller = g_form.getReference('service_offering', setLocation);
function setLocation(caller) {
if (caller)
g_form.setValue('business_service', caller.parent);
}
}
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 08:43 PM
hello,
For me it is working perfectly on my PDI.
When you say it is not working what is the behaviour you see?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 08:55 PM
Hi,
I modified the script and is now working. I removed the "If (caller)" under the function 😀
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var serv_offering = g_form.getReference('service_offering', setService);
}
function setService(serv_offering) {
g_form.setValue('business_service', serv_offering.parent);
}
//Type appropriate comment here, and begin script below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022 08:57 PM
Hello,
If my answer helped you can you also mark it as correct.
Thanks.