Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #LRNG_FORM)
* Includes
Define_Com Class(#LREXTLB1) Name(#main)
Define_Com Class(#LREXTLB1) Name(#row)

* Work Objects
Define_Com Class(#PRIM_ALPH) Name(#actionValue)
Define_Com Class(#PRIM_alph) Name(#dateDate)
Define_Com Class(#PRIM_ALPH) Name(#statusText)

Define Field(#lr_wkSep) Type(*char) Length(1)
Define_Com Class(#PRIM_ALPH) Name(#lrprops)


* GroupBy
Group_By Name(#rowData) Fields(#empno #surname #givename #deptment #section #address1 #address2 #address3 #phonehme #phonebus #salary)

* ===============================================================
*  LRELT001 - Mainline
* ===============================================================
Mthroutine Name(HandleRequest) Options(*REDEFINE)

Use Builtin(HextoBin) With_Args(FF) To_Get(#lr_wkSep)

* Set The Layout Folder
#main.layoutPath := '<Your Longrange Folder>/layouts/'
#row.layoutPath := '<Your Longrange Folder>/layouts/'

* And Load
#main.loadLayout Layout('main.txt')
#row.loadLayout Layout('row.txt')


If (#RequestACTION.Contains( '_' ))
#actionValue := (#RequestACTION).Substring( 1 ((#RequestACTION).PositionOf( '_' ) - 1) )
Else
#actionValue := #RequestACTION
Endif

Case Of_Field(#actionValue)


When Value_Is(= actionCustomer)


Otherwise /* Default */

#main.inflate


Select Fields(#rowData) From_File(pslmst)

#LISTCOUNT := #listcount + 1

* Inflate Row
#row.inflate Parent('/Form.fields.boxList') Index(#LISTCOUNT)

* * Set Text
#lrprops += #lr_wkSep + '/Form.fields.boxList.fields.boxRow_' + #LISTCOUNT.asstring + '.fields.title1.text:' + #empno

#lrprops += #lr_wkSep + '/Form.fields.boxList.fields.boxRow_' + #LISTCOUNT.asstring + '.fields.title2.text:' + #GIVENAME + ' ' + #surname
#lrprops += #lr_wkSep + '/Form.fields.boxList.fields.boxRow_' + #LISTCOUNT.asstring + '.fields.data1.text:' + #address1
#lrprops += #lr_wkSep + '/Form.fields.boxList.fields.boxRow_' + #LISTCOUNT.asstring + '.fields.data2.text:' + #address2
#lrprops += #lr_wkSep + '/Form.fields.boxList.fields.boxRow_' + #LISTCOUNT.asstring + '.fields.data3.text:' + #address3


#lrprops += #lr_wkSep + '/Form.fields.boxList.fields.boxRow_' + #LISTCOUNT.asstring + '.fields.data4.text:' + 'Business : ' + #phonebus



Leave If(#listcount *EQ 20)


Endselect

#LRNGSERVICES.SetfromStrings Separatorused(#lr_wkSep) Propertystrings(#lrprops)

Endcase
Endroutine

End_Com
