- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 06:33 PM
Hi all!
There's a problem with getUserId().
I have a business rule that will trigger when userA approves a record submitted by userB.
When approved, the business rule will post a work_note to the record. The author is expected to be userA because he is the one who approved it. But when I checked the record, userB is the author instead of userA.
When printing the userId of the current loggedin user, it is userB's sys_id that is printed instead of userA.
Why is this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 05:42 AM
I'm not using Before BR because I'm not updating the current object. I am using After BR because I'm updating another record that is related to the current object.
Also, when I checked the sys_journal_fields table, the name under the sys_created_by is userB, not userA. So, that's a thought...
Anyway, I moved the target table of my BR to approval table, instead of my custom Task table. This time, userA is now the author of the comment/work_note, which is correct.
Thank you so much for replying to my question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 05:42 AM
I'm not using Before BR because I'm not updating the current object. I am using After BR because I'm updating another record that is related to the current object.
Also, when I checked the sys_journal_fields table, the name under the sys_created_by is userB, not userA. So, that's a thought...
Anyway, I moved the target table of my BR to approval table, instead of my custom Task table. This time, userA is now the author of the comment/work_note, which is correct.
Thank you so much for replying to my question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 06:19 AM
@Lhora Alvarez : Please mark my solution as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
