Trying to script an approval on a record producer that creates an HR Case.

lydia3
Kilo Contributor

I have a record producer pulling in the manager that I need to approve the request in the Workflow, but trying to get it to work in the approval process has been unsuccessful.  

The record producer is called FromSupervisor, I also have the field populating into the HR_Case in a newly added field Record_Producer_3.

I assumed that I needed to push that field over in the Approval Script on the Workflow, but it continues to skip over the approvals (not referencing anyone)

answer.push(FromSupervisor)

Any guidance would be most appreciated.

1 ACCEPTED SOLUTION

Getting closer!   Now that you have a field u_approver that is a reference, it is expecting a sys_id of a user record.   In your script above you are setting it to the Display Value of the FromSupervisor.   This should get your squared away:


current.u_approver = producer.FromSupervisor; - this is assuming FromSupervisor is a reference variable for the sys_user table.


View solution in original post

15 REPLIES 15

Try answer.push(current.u_record_producer_3);



Just tried this version Michael, it is still skipping the approval and automatically marking as approved.  


What table is your workflow set to?   If hr_case then you should be able to just select that field by clicking the lock beside user and choose fields.



The workflow is set to the HR Case, but since the field is custom it does not reflect in the lock.   I hoped that it would myself, but not there.


can you please paste in a screen shot of the custom field dictionary record?