CREATE A BUSINESS RULE TO COPY RITM COMMENT/WORKNOTE INTO THE SYSAPPROVER_APPROVAL COMMENT FIELD

adaptivert
Giga Guru

I need help writing a business rule for the following:

 

1.  Reject a request item in the Employee Center.

2.  Enter a comment in employee center.

3.  Business Rule fires to copy that comment after insert in RITM to the related RITM sysapprover_approval record comment field.

@tangcov 

7 REPLIES 7

adaptivert
Giga Guru

Hello AshishKMishra,

 

Below is the screen shot.

 

adaptivert_0-1706917384667.png

 

ok , it's not clear that your system has approval/rejection on direct RIMT or sysapproval record.

so you check, if there is an approval record in sysapprover_approval table for the same RITM because the rejection reason ( or comment ) will go to record in sysapprover_approval table.


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Harish KM
Kilo Patron
Kilo Patron

Hi @adaptivert Write a after update BR on RITM table

BR cond: state is closed Incomplete AND // check state of RITM when rejected and put accordingly

comments changes

 

Script:

var comments = current.comments.getJournalEntry(1).split('\n');
var app = new GlideRecord('sysapproval_approver');
app.addQuery('sysapproval', current.sys_id);
app.query();
if(app.next()){
app.comments = "Comments Updated " +comments[1];
app.update();

}
Regards
Harish