Error calling PO Dispatch App Engine from PeopleCode
I'm trying to dispatch a PO from an App Package using CallAppEngine and am getting this error message.
ErrorReturn-> 164 - Function '%OutDestType' cannot be run on the application server. (180,164) PO_DISPATCH.PO_Dispatch_Print.OnExecute Name:dispatch PCPC:1153 Statement:25
I am not sure if I should and how I could specify the Output Destination Type with CallAppEngine.
Has anyone run into this problem?
Here is my code:
&stateRec = CreateRecord(Record.PO_DISP_AET);
&stateRec.OPRID.Value = %UserId;
&stateRec.RUN_CNTL_ID.Value = "PS_PO_DISPATCH_DEFAULT";
&stateRec.BUSINESS_UNIT.Value = &bu;
&stateRec.PO_ID.Value = &po_id;
&stateRec.EMAIL_DISP.Value = "Y";