peoplesoftpeoplecode

PeopleCode error while trying to call function on Page PeopleCode event


I am trying to add the below function (populate_details) to a Page PeopleCode Activate event. The top section of code already exists, I am trying to add the section starting at 6/24/20 comments and getting the error "Syntax error: expecting statement. (2,42) ^ HCSC" If I remove the top section of the code then the error does not display and it saves properly, so I must have some sort of syntax error. Thanks for the help!

enter image description here

import HR_DIRECT_REPORTS:EmployeeSelection;

Component HR_DIRECT_REPORTS:EmployeeSelection &MyUI;

&MyUI.PageActivate();

/*GHS KLG - link to Footprints on termination screen*/
If DERIVED_HR_DR.HR_DR_PAGE_TITLE.Value = "Terminate Employee" Then
   GHS_MSS_WRK.HTMLAREA.Value = MsgGetExplainText(31000, 27, "Message not found.");
   GHS_MSS_WRK.HTMLAREA.Visible = True;
Else
   GHS_MSS_WRK.HTMLAREA.Visible = False;
End-If;
/*GHS end*/
   

/* GHS KDR 6/24/20 BEGIN */

Declare Function populate_details PeopleCode GH_PERS_INF_WRK.FUNCLIB FieldFormula;

GH_PERS_INF_WRK.EFFDT = %Date;

populate_details(%Date, PERSON_NPC_VW.EMPLID.Value, GH_PERS_SRCH_CW.EMPL_RCD.Value);


/* GHS KDR 6/24/20 END */

Solution

  • You must declare your populate_details function at the top of the Page PeopleCode Activate event. Immediately after this line should work:

    Component HR_DIRECT_REPORTS:EmployeeSelection &MyUI;

    Then you can call your function as you did, the rest of the code looks fine.