Filter Code which Automatically Handles Changes to Instance List

RAMP-TS

Filter Code which Automatically Handles Changes to Instance List

This RDMLX code which is created by the Program Coding Assistant automatically handles events signaled by the RAMP screen (it is shown here just for your reference, you do not need to modify it):

 

* --------------------------------------------------------------------------------

* Handle any external requests to update the Instance List

* --------------------------------------------------------------------------------

EvtRoutine #Com_owner.avEvent WithId(#EventId) WithAInfo1(#AInfo1) WithAInfo2(#AInfo2) WithAInfo3(#AInfo3) WithAInfo4(#AInfo4) WithAInfo5(#AInfo5)  WithNInfo1(#NInfo1) WithNInfo2(#NInfo2) WithNInfo3(#NInfo3) WithNInfo4(#NInfo4) WithNInfo5(#NInfo5)

 

* put the received values into fields

Change #vf_elIdn #EventId.Value

 

* Map the AInfo and NInfo values passed, into the key fields - #EMPNO

 

Change #DEPTMENT #AInfo1

Change #SECTION #AInfo2

Change #EMPNO #AInfo3

 

Case #vf_elIDN

 

when '= Refresh_Instance_List'

* Reload the Instance List

 

Invoke #Com_Owner.uSelectData

 

when '= Add_List_Entry'

* Add an entry to the list view

 

fetch FIELDS(#XG_Ident) FROM_FILE(PSLMST) WITH_KEY(#EMPNO)

if_status *OKAY

 

* Start an instance list update

Invoke Method(#avListManager.BeginListUpdate)

 

* Set up the visual Identifier(s)

 

Change #UF_VisID1 #EMPNO

Change #UF_VisID2 #GIVENAME

Use BConcat (#UF_VisID2 #SURNAME) (#UF_VisID2)

 

* Add instance details to the instance list

 

Invoke #avListManager.AddtoList Visualid1(#UF_VisID1) Visualid2(#UF_VisID2) AKey1(#DEPTMENT) AKey2(#SECTION) AKey3(#EMPNO)  ACOLUMN1(#PHONEHME) ACOLUMN2(#ADDRESS1) NCOLUMN1(#POSTCODE)

* Instance list updating has been completed

Invoke Method(#avListManager.EndListUpdate)

 

endif

 

when '= Update_List_Entry'

* Update an entry that already exists in the instance list

 

fetch FIELDS(#XG_Ident) FROM_FILE(PSLMST) WITH_KEY(#EMPNO)

if_status *OKAY

 

* Start an instance list update

Invoke Method(#avListManager.BeginListUpdate)

 

* Set up the visual Identifier(s)

 

Change #UF_VisID1 #EMPNO

Change #UF_VisID2 #GIVENAME

Use BConcat (#UF_VisID2 #SURNAME) (#UF_VisID2)

 

* Add instance details to the instance list

 

Invoke #avListManager.UpdateListEntryData Visualid1(#UF_VisID1) Visualid2(#UF_VisID2) AKey1(#DEPTMENT) AKey2(#SECTION) AKey3(#EMPNO)  ACOLUMN1(#PHONEHME) ACOLUMN2(#ADDRESS1) NCOLUMN1(#POSTCODE)

* Instance list updating has been completed

Invoke Method(#avListManager.EndListUpdate)

 

endif

 

when '=  Delete_List_Entry'

Invoke Method(#avListManager.BeginListUpdate)

 

* Remove instance details from the instance list

 

Invoke #avListManager.RemoveFromList AKey1(#DEPTMENT) AKey2(#SECTION) AKey3(#EMPNO)

Invoke Method(#avListManager.EndListUpdate)

 

endcase

 

Endroutine

 

End_Com