The following example is the SavePostChange business object showing the function call cw_publish_event.
/* Place this code in Component's SavePostChg() and define the four parameters used in the function call */ Declare Function cw_publish_event PeopleCode FUNCLIB_CW.CW_EVENT_NOT FieldFormula; Component string &BONAME1; Component string &KEYLIST1; Component number &CWPRIORITY1; Component string &CONNID; &BONAME1 = "Psft_Dept"; &KEYLIST1 = "DEPT_TBL.SETID:DEPT_TBL.DEPTID"; &CWPRIORITY1 = 2; &CONNID = "PeopleSoft Connector"; /* Check if Component Changed before calling function */ If ComponentChanged() And %UserId <> "CW" Then /* Publish this event to the CrossWorlds CW_EVENT_TBL for polling */ cw_publish_event(&BONAME1, &KEYLIST1, &CWPRIORITY1, &CONNID); End-If;
The following example is the SavePostChange business object showing the function call cw_publish_future_dated_events.
/* Place this code in Component's SavePostChg() and define the four parameters used in the function call */ Declare Function cw_publish_event PeopleCode FUNCLIB_CW.CW_EVENT_NOT FieldFormula; Component string &BONAME1; Component string &KEYLIST1; &EFFDATE="DEPT_TBL_.STARTDATE"; Component number &CWPRIORITY1; Component string &CONNID; &BONAME1 = "Psft_Dept"; &KEYLIST1 = "DEPT_TBL.SETID:DEPT_TBL.DEPTID"; &CWPRIORITY1 = 2; &CONNID = "PeopleSoft Connector"; /* Check if Component Changed before calling function */ If ComponentChanged() And %UserId <> "CW" Then /* Publish this event to the CrossWorlds CW_EVENT_TBL for polling */ cw_publish_future_dated_events(&BONAME1, &KEYLIST1, &CWPRIORITY1, &CONNID, &EFFDATEW); End-If;