I have the following functions that I am trying to modify to default in a Printer output destination within Pay Cycle Manager in FSCM 9.2, but need to get a better understanding of what the current customization is doing.
We have a custom function in Record PeopleCode (PYCYCL_STATRPT.PAY_RUN_AP_STATUS) (RowInit event) that is defined as follows:
Function GHS_Set_OutDest(&STATUS) Returns string;
PYCYCL_STATRPT.SERVERNAME = "PSNT";
PYCYCL_STATRPT.OUTDESTTYPE = "2";
If &STATUS = "Z" Or
&STATUS = "C" Then
&GHS_STRING_ID = "OUTDEST_POSPAY";
Else
If Substring(PYCYCL_STATRPT.PAY_CYCLE, 1, 3) = "AUX" Then
&GHS_STRING_ID = "OUTDEST_AUX";
End-If;
If Substring(PYCYCL_STATRPT.PAY_CYCLE, 1, 3) = "CTS" Then
&GHS_STRING_ID = "OUTDEST_CTS";
End-If;
If Substring(PYCYCL_STATRPT.PAY_CYCLE, 1, 4) = "MAIN" Then
&GHS_STRING_ID = "OUTDEST_MAIN";
End-If;
If Substring(PYCYCL_STATRPT.PAY_CYCLE, 1, 5) = "POSPY" Then
&GHS_STRING_ID = "";
End-If;
If Substring(PYCYCL_STATRPT.PAY_CYCLE, 1, 5) = "QUICK" Then
&GHS_STRING_ID = "OUTDEST_QUICK";
End-If;
If Substring(PYCYCL_STATRPT.PAY_CYCLE, 1, 6) = "REFUND" Then
&GHS_STRING_ID = "OUTDEST_REFUND";
End-If;
If Substring(PYCYCL_STATRPT.PAY_CYCLE, 1, 2) = "R_" Then
&GHS_STRING_ID = "OUTDEST_REFUND";
End-If;
If Substring(PYCYCL_STATRPT.PAY_CYCLE, 1, 5) = "RSTRT" Then
&GHS_STRING_ID = "OUTDEST_RSTRT";
End-If;
End-If;
SQLExec("SELECT STRING_TEXT FROM PS_STRINGS_TBL WHERE PROGRAM_ID = 'APY2055' AND STRING_ID = :1", &GHS_STRING_ID, &GHSOUTDEST);
/*WinMessage("GHS_Set_OutDest_1: " | PYCYCL_STATRPT.PAY_RUN_AP_STATUS | " " | &STATUS | " " | &GHSOUTDEST, 64);*/
Return (&GHSOUTDEST);
End-Function;
From what I can tell, it looks like this function returns the variable &GHSOUTDEST back to the code that is calling it, which I believe is below where it is being declared on other Record PeopleCode (PYCYCL_STATRPT.OUTDESTTYPE) (FieldChange event):
Declare Function GHS_Set_OutDest PeopleCode PYCYCL_STATRPT.PAY_RUN_AP_STATUS RowInit; /* GHS, declared in PYCYCL_STATRPT.OUTDESTTYPE.FieldChange */
&OPRID = %OperatorId;
Evaluate PYCYCL_STATRPT.OUTDESTTYPE
When = "2"
SQLExec("select srvrdestfile from ps_opr_def_pycycl where oprid = :1", &OPRID, PYCYCL_STATRPT.OUTDEST);
Break;
When = "3"
SQLExec("select srvrdestprinter from ps_opr_def_pycycl where oprid = :1", &OPRID, PYCYCL_STATRPT.OUTDEST);
Break;
When = "6"
SetDefault(PYCYCL_STATRPT.OUTDEST);
Break;
End-Evaluate;
/* PYCYCL_STATRPT.OUTDEST = GHS_Set_OutDest(PYCYCL_STATRPT.PAY_RUN_AP_STATUS); */
My question is, if where the function is Declared (immediately above) is what is calling the main function defined within PAY_RUN_AP_STATUS field, why am I not seeing the output (Return) variable (&GHSOUTDEST) being used in the Declaration statement? In the Evaluate statement below the function declaration, is the return values from the function being used in any way for the Evaluate instruction? It looks like the 2nd Bind variable in the SQLExec statement (PYCYCL_STATRPT.OUTDEST) is what is setting the OUTDEST field?
From here I would like to be able to default in a specific Printer destination path, depending on what step (status) the pay cycle manager is in, as it needs to go to a different location for check printing, then it does for printing the Advice.