Additional approvers script

chrisdamico
Kilo Explorer

I have a variable on the catalog form; Business Unit CFO Approver (value is cfo_approver).   It's a reference to a table that has a list of the CFO's.  

In my workflow, I want to include the CFO as an approver.   In a Approval - User activity, I used the additional approvers script and added:

answer = current.variables.cfo_approver;

This is not working.   Please help.

13 REPLIES 13

amlanpal
Kilo Sage

Hi Chris,



I guess, you have used Approval -User activity. Please check 'Advanced' and in the script write the below lines:


answer = [];


answer.push(current.variables.cfo_approver.toString());



I hope this helps.Please mark correct/helpful based on impact


Thanks.



Unfortunately this did not work.   It's just bypassing the approval step and automatically approving it.


Hi Chris,



In that case I would request you to cross check that the selected user's profile. Make sure that the user is Active (Active is Checked) and not Locked out (Locked out is Unchecked).



I hope this helps.Please mark correct/helpful based on impact


Hi chrisdamico,



Did you able to have a look at my last response?


If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.


If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review   How to Mark Answers Correct From Inbox View


Yes and here is what's going on.



I put the log statement in the Additional Approvers script to help troubleshoot.



gs.log("current cfo approver "+ current.variables.cfo_approver);


var answer = [];


answer.push(current.variables.cfo_approver);



It's returning the sysid of the wrong field so hopefully you can help me out.   Here is the reference table.   It's returning the sysid of the business unit field and not the user field.


find_real_file.png