OnChange client script or business rule to not all change form to close if category is other and to remain on the review state with an error message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 08:36 AM
I have a requirement to not allow change for to close if category is "other" and state is "close"
I did a business rule and does not work as expected.
I would like to see the firm stay on review with an error message, "please select correct category besides other"
I feel like an OnChange client script will work better but not very familiar with client scripts
Can I get help please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 01:26 PM
Hi, unfortunately a partial screenshot of your laptop screen does not provide any details that would allow the forum to assess your script.
An onChange() Client script could be used to prevent options from being available in a choice list if the record is in a specific state, but normally I would also an a before() BR to ensure any update was aborted if the user was somehow able to circumvent the client script (if the client script failed to load, the user made the update from list view etc).
Perhaps you could attach a plain text version of your BR (an xml export is best) and a clear description of the requirement, actual field names etc; so that the forum can better understand what it is you are trying to do as your post is not very clear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2022 07:55 PM
it does work with the BR but throws an error message invalid input, plus it defaults to closed, only when I refresh the page does it change to review
Please see my BR here
Thank you
and
I understand with abort action selected, it will always show invalid input but my concern is that the form actually closes and I would like for it to remain on review prompting the user to select to change the category to something else besides other
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 08:48 AM
Please also keep in mind that I am not trying to make any options not available in the choice list, I will like the choice list to remain as it is but prompt the user to change selection if the category is "Other" and they select close to close out the form. As stated earlier, the Business rule works partially, I just wish for it to remain in the review state and the prompt the user to change category. Right now, when I select closed, it seems like it closed and that my expected message pops up with the invalid input then I have to refresh the page to see it on the review state
my users will not know to refresh the page
Thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2022 08:57 AM
Hey
Try using this:
current.setAbortAction(true);
action.setRedirectURL(current);
current.state = previous.state;
current.update();
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar