Writing to the activity log/Work Notes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2014 01:28 PM
I'm trying to write to the work_notes field in a before insert business rule. i've tried:
1. current.work_notes = ".....";
2. current.work_notes.setJournalEntry('....');
I've seen #1 work but not consistently. I'm not sure if there is a scud missile effect going on as other things are being written to the activity log at the same time.
Does anyone have any advice?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2014 07:53 AM
Never mind my last answer (as I said we don't use work_notes), I found an out of the box business rule (Assign from Stock) that does exactly what you are trying to do in a before update rule : current.work_notes = "Configuration item assigned from stock"; So there has to be something else going on your side. Sorry, not much help here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2014 09:29 AM
#1 should be working here. The only other thing that I could think of would be if you had an "After", "Insert" or "Update" Business Rule that was overriding this one, but then again- this would all be captured in the Activity Log. You could check this by adding gs.log() statements in your Business Rule to see definitively if this Business Rule was running or not. For example, that line of: current.work_notes = "random text string...."; - This occurs before the record is inserted into the table in the database. Are you sure you have Work Notes visible in the Activity Log?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2014 09:50 AM
I want to expand slightly on Jamison's thought about things going wrong.
Another issue which has bit me, is an error in the BR. If the error occurs towards the end of the rule, you might think the BR completed successfully, since most of the functions will have been performed. But if the error occurs towards the end of your BR and the line reading "current.work_notes = ..." is after the error, then that may be your problem.
Put a gs.log("got here"); line next to your line assigning a value to the work_notes and then check the log ( Script Log Statements). If you don't see "got here", then your statement to assign the work_notes never got a chance to execute.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2014 09:57 AM
Both the codes should be actually working. There might be any business rule which is conflicting the insertion into Journal Field Entry. Try debugging business rules to see whether you are having a conflict.
Also, you could check sys_journal_field table to verify whether your entry for work_notes had possibly been created there.
Regards,
Manish