- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 08:47 AM
I have a requirement to autopopulate opened for user name which is present in employee relation case form . i need to populate opened for name in involved party form "user" field based on reporter dropdown selec from "type" i write a below script. But in user field its showing "No Preview available.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 12:11 AM
Hello @ash_1998 ,
Please use glideAjax (Script Include) for the same.
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 12:11 AM
Hello @ash_1998 ,
Please use glideAjax (Script Include) for the same.
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 08:12 AM
Thank you. its working by using Script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 01:02 AM - edited 12-22-2023 01:05 AM
Hello @ash_1998,
Please give a try with the script below and let me know how it works for you.
onChange Client Script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ty = g_form.getValue("type");
if (ty == "46d44a23a9fe19810012d100cca80666") {
var userref = g_form.getReference('opened_for', userLookup);
}
function userLookup(userref) {
if (userref) {
g_form.setValue('user', userref.name.toString());
} else {
alert('User reference not found.');
}
}
}
Additionally if you still face the issue with "No preview available" then please let me know or if it worked then I would suggest to create one system property and store your sys_id there and then create one script include and use that in client script to avoid the using sys_id directly in the scripts or else you can you one Display BR as well but before that firstly check how the current script works .
Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks,
Aniket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 08:14 AM
Thank you for your response Aniket. by using script include its working well