GetCompIntfc method: Session class

Syntax

GetCompIntfc([COMPINTFC.]ComponentName)

Description

The GetCompIntfc method, used with the session object, returns a reference to a Component Interface. ComponentName when used by itself takes a string value. If you use COMPINTFC.componentname it isn’t a string value: it’s a constant that automatically is renamed in your code if the Component Interface definition is ever renamed. You must specify an existing Component Interface, otherwise you receive a runtime error.

Example

Local ApiObject &MYSESSION;
Local ApiObject &MYCI;

&MYSESSION = %Session;
&MYCI = &MYSESSION.GetCompIntfc(COMPINTFC.PERSONAL_DATA_BC);

The following example uses the '@' operator to dynamically call a Component Interface from PeopleCode.

&MYCI = &MYSESSION.GetCompIntfc(@("CompIntfc." | &CIname));