- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 02:03 PM
I've created a Business Rule that will select a specific value in a choice field (dropdown with None) if another field is checked. It works. But if I uncheck the box, the choice remains. Doesn't return to None.
When to Run:
Field Name is true
Actions:
Field Name To 'Requires Approval'
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 02:38 PM
Hi @MStritt
You will need to explicitly specify what the BR should do when the Field Name is false.
It won't just do the opposite when the condition is not met.
You can either create another BR with something like when Field Name is false -> Field Name to 'None'
Or modify your existing BR with some script. When to run will be when Field Name changes and the script will be something like:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(current.getValue('your_check_box') == true)
{
current.setValue('your_field_name', 'requires_approval');
}
else
{
current.setValue('your_field_name', '');
}
})(current, previous);
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 02:38 PM
Hi @MStritt
You will need to explicitly specify what the BR should do when the Field Name is false.
It won't just do the opposite when the condition is not met.
You can either create another BR with something like when Field Name is false -> Field Name to 'None'
Or modify your existing BR with some script. When to run will be when Field Name changes and the script will be something like:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
if(current.getValue('your_check_box') == true)
{
current.setValue('your_field_name', 'requires_approval');
}
else
{
current.setValue('your_field_name', '');
}
})(current, previous);
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 02:40 PM
haha beat me to it!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 02:39 PM
How about...
When to Run:
Field Name changes
Script goes something like
If field name = true; then field name2 == "requires Approval"
else; then field name2 == ' ';
??