- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2015 02:40 PM
Hi,
I am trying to Auto Populate a field when a selection is a made from a drop down using client script.
My script which does not work is below. Any help would be appreciated.
So When "Risk Type" Corporate is selected the "Internal ref" should Auto Populate to CO000
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var svc = g_form.getReference('Corporate');
g_form.setValue('SR000', internal_ref);
}
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2015 03:20 AM
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
var svc= g_form.getValue("u_risk_type");
alert('Outside'+svc);
if (svc == "Corporate") {
alert('Inside');
g_form.setValue("u_internal_ref", "CO000");
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2015 02:34 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2015 02:37 AM
Right click on the field and select 'Show Internal Ref" . Post the screenshot of the pop up..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2015 03:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2015 03:14 AM
Is the field read only ? If not, I do not see any error in the script ... You can put the alert inside the 'if' statement and check if the script is working as desired.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2015 03:17 AM
Hi,
The field is not read only.
How do I try with the Alert inside the If statement. I am not a scripter so a lot of this is jargon to me.
Thanks
Riaz