Change a work_note in a Form View

pedro_lebron
Tera Contributor

I am trying to change single work notes / comments in Form View using a business rule. I'd like to get the same result you could get using:

 

g_form.setvalue('description', 'This is an example')

 

 So far, I have only found methods to update this field at database, which doesn't work for my use case.

2 REPLIES 2

Ayushi12
Mega Sage

Hi @pedro_lebronIf you are trying to update worknotes/comment,please refer to the document: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0520375
To set work notes using the Business rule try using the before the business rule, add the following script, and set the when condition:

current.work_notes = 'This is example';
Please mark the answer correct and helpful if applicable. Thanks!

Aman Kumar S
Kilo Patron

Hi @pedro_lebron 

You can simply use below statement for updating work notes/comments via BR:

g_form is available for client scripts, can't be used in server side script

 

When it comes to BR, it supports server side script and use following for that:

current.work_notes = 'My Work notes';

OR

current.comments = 'My comments';

 

Best Regards
Aman Kumar