Sample Relationship Reusable Part

Visual LANSA Framework

Sample Relationship Reusable Part

*  =============================================================================

*

*  Component   : DF_T3507

*  Type        : Reusable Component

*  Ancestor    : VF_AC023

*  May be used with both VLF-WEB and VLF-WIN versions

*  =============================================================================

 

Function Options(*DIRECT)

begin_com role(*EXTENDS #VF_AC023)

 

mthroutine name(uAddEntriesFor) options(*REDEFINE)

 

 

CASE OF_FIELD(#SourceType)

 

WHEN VALUE_IS('= DEM_ORG')

* Expand Sections in a Department/Organization

 

#DEPTMENT := #AKEY1

SELECT FIELDS(*ALL) FROM_FILE(SECTAB) WITH_KEY(#DEPTMENT)

 

Signal uAddListItem AKey1(#DEPTMENT) AKey2(#SECTION) VisualId1(#SECDESC) VisualId2(#SECTION) AColumn1( #SECADDR1) AColumn2(#SECADDR2) AColumn3(#SECADDR3) AColumn4(#SECPHBUS) NColumn1(#SECPCODE) BusinessObjectType(#TargetType)

 

ENDSELECT

 

 

WHEN VALUE_IS('= DEM_ORG_SEC')

* Expand Employees in a Department/Section

 

 

CHANGE FIELD(#DEPTMENT) TO(#AKey1)

CHANGE FIELD(#SECTION) TO(#AKey2)

 

SELECT FIELDS(*ALL) FROM_FILE(PSLMST1) WITH_KEY(#DEPTMENT #SECTION)

 

Signal uAddListItem AKey1(#DEPTMENT) AKey2(#SECTION) AKey3(#EMPNO) VisualId1((#Givename + ' ' + #Surname)) VisualId2(#EMPNO)  AColumn1(#ADDRESS1) AColumn2(#ADDRESS2) AColumn3(#ADDRESS3) AColumn4(#PHONEBUS) AColumn5(#PHONEHME) AColumn6(#DEPTMENT) AColumn7(#SECTION) NColumn1(#POSTCODE) BusinessObjectType(#TargetType)

 

endselect

 

OTHERWISE

 

ABORT MSGTXT('Unknown source business object type encountered by component DF_T3507')

 

ENDCASE

 

endroutine

 

End_Com