Generating PeopleCode for a File Layout
After you create a file layout definition, you can use PeopleCode to access it. This PeopleCode can be long and complex. Rather than write it directly, you can drag and drop the file layout definition from the PeopleCode Application Designer Project view into an open PeopleCode edit pane. Application Designer analyzes the definition and generates initial PeopleCode as a template, which you can modify to meet your requirements.
This example shows some of the code that is generated:
Function EditRecord(&REC As Record) Returns boolean ;
Local integer &E;
REM &REC.ExecuteEdits(%Edit_Required + %Edit_DateRange +
%Edit_YesNo + %Edit_TranslateTable + %Edit_PromptTable +
%Edit_OneZero);
&REC.ExecuteEdits(%Edit_Required + %Edit_DateRange +
%Edit_YesNo + %Edit_OneZero);
If &REC.IsEditError Then
For &E = 1 To &REC.FieldCount
&MYFIELD = &REC.GetField(&E);
If &MYFIELD.EditError Then
&MSGNUM = &MYFIELD.MessageNumber;
&MSGSET = &MYFIELD.MessageSetNumber;
&LOGFILE.WriteLine("****Record:" | &REC.Name | ",
Field:" | &MYFIELD.Name );
&LOGFILE.WriteLine("****" | MsgGet(&MSGSET,
&MSGNUM, ""));
End-If;
End-For;
Return False;
Else
Return True;
End-If;
End-Function;
.
.
.
.