Trigger onChange on field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2016 04:33 PM
Hi,
On change table we have a custom field called failure. I want to trigger an OnChange event on Risk field on change of Failure field. I have created below client script but does not seem to be working. any help?
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var temp=g_form.getControl('risk');
temp.onChange();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2016 04:38 PM
Hi Padmini,
Can you give more details on where is the script defined and what is the expected outcome.
// temp.onChange(); Can you please explain what this script line does.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2016 04:51 PM
Well, the background is:
I have two datalookup rule:
Rule 1 : The "Likely Faiure" and "Failure Consequence" field defines the Risk field value. The risk field is a readonly field
Rule 2 : The Risk and Impact field values define the category field value.
When the Risk field is being updated by datalookup rule, it is not triggering a UI change on Riskfield and because of this the Category value is not beilng calculated onChange of Risk value. I have learned that the datalookup function trigger only when there is a UI change on field or an Onchange is triggered by client script.
Now, I am trying trigger Onchange event on Risk field when ever the "Likely falure" and the "Failure Consequence" changes.
I can achieve by setting the same value to Risk field again. However, on of my colleague did mention that I can trigger an Onchange event but now he is on holiday. I am trying that approach but is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2016 04:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2016 05:37 PM
I did, but still it is not triggering an Onchange on form inorder trigger the 2nd datalookup rule