JointLantic

How to Check Record is Changed in PeopleCode

How to Check Record is Changed in PeopleCode

How to Check Record is Changed in PeopleCode in scroll level 1 and level 2 and more level

For example check record is changed in level 1 by use peoplecode function IsChanged() in the event action of SavePreChange.

Example 1

Local Rowset &Level0_ROWSET, &LEVEL1_ROWSET;
&Level0_ROWSET = GetLevel0();
For &I = 1 To &Level0_ROWSET.ActiveRowCount

If RecordChanged(Record.CONTRACTS, CurrentRowNumber()) Then
rem WinMessage(“Changed row message from level one.”, 64);
CONTRACTS.LAST_EMPLID.Value = %OperatorId;
CONTRACTS.LAST_UPDATE_DTTM1.Value = %Datetime;
End-If;
End-For;

Example 2

or copy code at here

Local Rowset &Level0_ROWSET, &LEVEL1_ROWSET;

If %Page = Page.CONTRACTS Then

&Level0_ROWSET = GetLevel0();
For &A0 = 1 To &Level0_ROWSET.ActiveRowCount

/***************************/
/* Process Level 1 Records */
/*————————-*/
If &Level0_ROWSET(&A0).ChildCount > 0 Then
For &B1 = 1 To &Level0_ROWSET(&A0).ChildCount
&LEVEL1_ROWSET = &Level0_ROWSET(&A0).GetRowset(&B1);
For &A1 = 1 To &LEVEL1_ROWSET.ActiveRowCount
If &LEVEL1_ROWSET(&A1).GetRecord(1).IsChanged Then
rem WinMessage(“ischanged”, 0);
CONTRACTS.LAST_EMPLID.Value = %OperatorId;
CONTRACTS.LAST_UPDATE_DTTM1.Value = %Datetime;
End-If;
End-For;
End-For;
End-If;
End-For;
End-If;

More example of level 2 and level 3 from below reference: https://docs.oracle.com/cd/E80738_01/pt854pbh2/eng/pt/tpcd/concept_UnderstandingDataBufferClassesExamples-074aee.html#topofpage

Exit mobile version