- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2015 02:09 AM
Hi All,
I have written below script to auto populate one field, "onChange" of another field. It is working fine on catalog form but it is not working on RITM form.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var val = g_form.getReference('user',pop);
function pop(val)
{
alert("inside fun");
g_form.setValue('region',val.email);
}
}
Please try this and let me know if you have any solution for this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2015 10:36 PM
I raised a ticket for this issue in HI instance and they provided the solution like below
if (typeof g_sc_form != "undefined")
var val = g_sc_form.getReference('user',pop);
else
var val = g_form.getReference('user',pop);
I tried this and it is working perfectly....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2015 07:36 AM
I am not sure whether OOB issue, but was facing the same.
Finally closed it by creating a onload client, with a condition catalog item name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2015 07:46 AM
If I written onLoad client script means it works on On load of the form only right ? but I want this script to be run on onChange of the field. Is this possible in any other way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2015 07:35 AM
Is the script running at all? Add an alert in the beginning of the script to see if it is running on the RITM.
Note: If another UI Policy or Client Script fails on the RITM, this CS may NOT be executed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2015 07:41 AM
No, it is not going inside the function...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2015 07:48 AM
Are you expecting it to run as soon as you load the form? If so, you can try the following:
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == '') {
return;
}
var val = g_form.getReference('user',pop);
function pop(val)
{
alert("inside fun");
g_form.setValue('region',val.email);
}
}
Thanks,
Berny