How to give the condition when incident updation not in creation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 03:34 AM - edited 02-13-2024 03:35 AM
Hi,
I have created business rule for time worked field but that business rule is working for when incident record is creation and updation but I want that business rule should work only when record is updation not for creation so how to do that? I have provided below code is done previously.
Can you please help on this, It will be helpful.
Thanks in Advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 03:53 AM
Hi @mania ,
In when to run section if we choose before update , then that BR will trigger only for updation.
Could you please verify once more..whether you have not selected before insert?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 03:57 AM - edited 02-13-2024 04:01 AM
I have tested multiple times but when record creation I got the error message when time worked is empty but I dont want that Error message when record creation.
Its only Before - update
Can you please help on this, It will be helpful.
Thanks!
Mania
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 04:03 AM - edited 02-13-2024 04:12 AM
Hi @mania ,
Please verify whether there is any other BR created for before insert with same condition.
BR will only trigger based on the When to Run condition.
Also clear cache and try once.
if that also not resolving then try using below condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 04:02 AM
you can put your code inside this
if (current.update() && !current.insert()) {
// Your business rule logic here gs.info("Business rule executed on update");
}