- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2017 09:18 AM
Is there a way to set a default value by using a UI Policy? I am making some changes to our change_request form. We have 3 types of Change Requests:
- Normal
- Standard
- Emergency
If Emergency is selected, I need the Out Of Band value to be automatically be defaulted to yes or true. If it is a Standard or Maintenance, I need to Out Of Band field to still show but not default to Yes\True or No\False. I know I can set a default value on the dictionary entry but that would default Out of Band for all 3 categories which isn't what I need to happen. Thanks for any feedback!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2017 09:50 AM
Hi,
Write an On Change Client script with the Field Name selected as Change Type field having values "Emergency, Normal etc. Below code should work for your requirement:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(newValue=='Emergency')
{
g_form.setValue('Field Name',true);
}
else if(newValue == 'Normal')
{
g_form.setValue('Field Name',true);
}
}
Note: Replace the field Name in the script above with the exact Field Name you want to set the value for.
Hope this help. Mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2017 07:18 AM
Hi Jonathan,
Glad you/we resolved it.
Please can you mark my response correct and helpful by clicking on your post link (Setting Default Values ) to help close out open questions and aid others with similar questions.
PS - The reason to implement this via a UI policy over a client script is that the UI policy will only be called when the condition is met, and not on every load.
Thanks,
Robbie