To optimize processing of a Component interface peoplecode we can use ItemByKeys method. In some programs we might need to traverse across all the collections to determine where to insert our new row.
By using this method we can minimize the traversing and decrease the processing time. Certainly this will help where the number of rows which need to process are huge.

ItemByKeys

Syntax

ItemByKeys(Key1,Key2…) 

Description

The ItemByKeys method returns the item specified by the parameters. The number and type of keys are unique to each specific collection.

Example PeopleCode:

 &oHjpmJpmPersonProfileSrv = &oSession.GetCompIntfc(CompIntfc.HJPM_JPM_PERSON_PROFILE_SRV);
 &oJpmJpCatTypeCollection = &oHjpmJpmPersonProfileSrv.JPM_JP_CAT_TYPE;
 &oJpmJpCatType = &oJpmJpCatTypeCollection.ItemByKeys(“COMPETENCY”);

Advertisements