Worknotes getting update twice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 04:56 AM
Hi All,
I have requirement to set work notes of related list entry numbers when record is inserted. I created before insert business rule which is working fine sets value of count and worknotes. But when I made first update to record worknotes comes twice and after first update if I made any update work notes comes one time as usual worknotes comes. Please help to resolve this issue why worknotes comes twice when first update is made to record.
Attached is screenshot of issue.
Regards,
Tara Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 05:09 AM - edited 11-20-2024 05:14 AM
Using current.update() in before BR can result in unintended results so it is not advisable
Generally, you do not use current. update() in a Before Business Rule because the record has not been saved yet
Thanks,
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 05:19 AM
Please check business rules for table. Possibly another business rule would be running on update or insert & updating worknotes.
Thanks,
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 05:23 AM
Hi @Tarasingh26 ,You can try with the following line of code.
As you created BR before Insert so validate if it is newRecord then and then it should be update.
if (current.isNewRecord())
{
// Your code
}
Please mark my response as correct and helpful if it helped solved your question.
Thanks,
Rohit Suryawanshi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 05:36 AM
@Rohit99 I implemented current.isNewRecord() but still works notes getting updated twice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 06:07 AM
@Tarasingh26 can you please check like it may happen if you click on insert and stay and thats why two BR's are created.