Client Script for Error Message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2017 08:05 AM
Hi I'm trying to write a client script to make an error message when the "Portfolio" field is changed to "AIT" and the choice field below it (A question about being submitted on behalf of a Business Partner) has not be answered already. This is the script I have so far, but it is not working. The commented out part I'm not sure if I need or not, I had it originally but was trying to see if it would work without it. Any ideas would be very appreciated!
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
//if (isLoading || newValue === '') {
// return;
//}
if(g_form.getValue('portfolio')=='AIT'
&& g_form.getValue('u_choice_1')==''){
g_form.addErrorMessage('Please answer "Business Partner" Question');
}
}
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2017 08:29 AM
Hi Aubrey,
This is choice field so it will work the usual way
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Alert telling user to update portfolio based on the business partners business group/department
if(g_form.getValue('u_choice_1')==1){
g_form.alert("Please update the Portfolio to represent the Business Partner's Business Group/Department");
}
}
Just make sure that in choice of u_choice_1 'YES' has the value 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2017 08:30 AM
Also, please mark the post answered if your query is resolved.