How to add a dropdown/selectbox to service portal approval record

Bruler1230
Tera Expert

Hello,

I have a request to add a dropdown/selectbox to the service portal approval record page. use case would be when an approver is approving a request, they would also like to have a dropdown that they can pick an option. For example, the approver could select from the dropdown "Go do this work" or "put this in the backlog" and then select Approve. Any ideas on this? or other solutions?

Thanks.

11 REPLIES 11

add something like below to

client script 

c.action = function(state, mySelect) {
if(c.data.esignature.e_sig_required) {
var requestParams = {
username: c.data.esignature.username,
userSysId: c.data.esignature.userSysId
};
spUIActionsExecuter.executeFormAction(ESIGNATURE[state], "sysapproval_approver" , c.data.sys_id, [] , "", requestParams).then(function(response) {
});
} else {
c.data.op = state;
c.data.mySelect = mySelect;
c.server.update().then(function() {
if (!c.data.updateID) // update failed
spUtil.addErrorMessage(c.data.actionPreventedMsg);
else
c.data.state = state;
});
}
}

server

if (input && input.op && data.isMine) {
gr.state = input.op;

gr.u_yourfieldname = input.mySelect;
data.updateID = gr.update();
if (GlideStringUtil.nil(data.updateID)) {
// update failed so fetch again for correct values
gr = $sp.getRecord();
}
data.op = "";
}

Also make sure you add  <button type="button" name="approve" class="btn btn-success btn-question" ng-click="c.action('approved', mySelect)">${Approve}</button>
<div class="spacer"></div>
<button type="button" name="reject" class="btn btn-default btn-question" ng-click="c.action('rejected', mySelect)">${Reject}</button>

thanks for your help..I am having some trouble getting this to work. i can give access to dev instance as well, if needed. 

i made these changes but i cant figure out to get the value that they select from the dropdown. any additional help would be appreciated.

Thanks

And the "gr.u_yourfieldname = input.mySelect;"

where should that field be created? on the RITM? Or i am missing something?