- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 04:45 AM
HI All,
For one of my requirements, I have to check while updating a form if the template value contains fields like
Short Description and assignment group with values, currently I am using below script with split twice, but somwhere I feel like we have better way to configure this also this script is not validating in case one field is missing. Looking forward to the comments on this. Thanks
Using Business rule
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 01:26 AM
HI Tushar,
Thanks for the code but this only works to check if it has short description and assignment group and not if it is blank,
However I was able to tweak the regex bit and now it is working as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2023 06:19 AM
Hi there,
var templateValue = current.u_template_values;
// Check if it has short_description and assignment_group then abort action
if (!/short_description=[^|^$]*\^|assignment_group=[^|^$]*\^/.test(templateValue)) {
current.setAbortAction(true);
gs.addErrorMessage('Please include both "short_description" and "assignment_group" in the template with values.');
}
Please mark this response as correct and/or helpful if it assisted you with your question.
Regards,
Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 01:26 AM
HI Tushar,
Thanks for the code but this only works to check if it has short description and assignment group and not if it is blank,
However I was able to tweak the regex bit and now it is working as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 04:43 AM
Hi there,
I thought so,i was missing something here and thanks for sharing the final solution.
Great work.