Portal - Request Summary Screen

Linda_G
Kilo Sage

I have a requested item that has a requested for variable.  It's set to default to one certain user because no others are able to access this catalog item.  The problem i'm having is the request summary screen is defaulting to ME after I submit the request, which is making the approvals go to my manager instead of the manager of the requested for in the variable.

I've set the default value of the variable to this specific user.

I've set the workflow approval to go to the requested_for.manager.

Here is the page I'm talking about. 

Can anyone help with this?

Thanks,

Linda

1 ACCEPTED SOLUTION

palanikumar
Mega Sage

Hi,

In screenshot it is referring the Requested for field in REQ table. If you want this to be populated with the value in Requested for variable then create a business rule on insert for Requested Item table with below code

(function executeRule(current, previous /*null when async*/) {
  if (!JSUtil.nil(current.variables.requested_for)) {
    var gr = current.request.getRefRecord();
    if(gr.isValidRecord()) { 
      gr.requested_for = current.variables.requested_for;
      gr.update();
    }
  }
})(current, previous);
Thank you,
Palani

View solution in original post

1 REPLY 1

palanikumar
Mega Sage

Hi,

In screenshot it is referring the Requested for field in REQ table. If you want this to be populated with the value in Requested for variable then create a business rule on insert for Requested Item table with below code

(function executeRule(current, previous /*null when async*/) {
  if (!JSUtil.nil(current.variables.requested_for)) {
    var gr = current.request.getRefRecord();
    if(gr.isValidRecord()) { 
      gr.requested_for = current.variables.requested_for;
      gr.update();
    }
  }
})(current, previous);
Thank you,
Palani