Component Interface
Component Interface
Name
Keys
Properties
Collections
Methods
Name
The Name of the Component Interface is the unique name by which we can identify
the CI. Calling the CI is also done with the help of this name.
Keys
These are special properties that can retrieve the values from a CI. The three types
of keys that a Component Interface has are the following:
Get Keys: These keys return one instance of the Component Interface. These keys
are created based on the search record and map to the Search Keys in the search
record.
Find Keys: These keys return a list of instances of the CI. These too are created
based on the search record and map to the combination of Search Keys and
Alternate Search Keys of the Search record.
Create Keys: Create keys are created only when the associated Component has the
Add action enabled.
Properties
Properties of a CI provide access to the Component Interface’s settings and the data
from the underlying Component. We can broadly classify properties into two:
Standard Properties: There are some properties that get assigned automatically
when a CI gets created. These standard properties cannot be viewed through
the Application Designer. Some examples for such properties are InteractiveMode,
GetHistoryItems etc.
User Defined Properties: These properties map to the record fields on the
Component. These are displayed in Application Designer and you can choose the
properties that need to be included in the Component Interface.
Collections
This is a special property that corresponds to a scroll area. It can contain fields or
subordinate scrolls, as is the case in the Component. The default name of a
collection would be same as that of the primary record for the underlying scroll.
Methods
Methods are functions that perform a specific task on a CI at runtime. Runtime
access to each method is governed by the security level that you have for the
specific method. Like Properties, Methods too can be classified into two:
Standard Methods: These are the methods that are available for all CIs. Certain
standard methods like Find, Get, Save and Cancel get created automatically when
CI is created. The Create method is created only if the underlying Component has
the Add action enabled.
User Defined Methods: In addition to the standard methods, we can create our own
functions and expose them through the CI as methods for added functionality. Such
methods are called user-defined methods. Each user defined method maps to a
function. Such methods are highlighted in blue in the Component Interface Designer.
Tags: Component Interface, Index
2. Architecture of CI? Or what are the main elements in the component Interface?
Main elements of component Interface
• Component interface name
• Keys
• Properties and collections
• Methods
&Session = GetSession();
&CI = &Session.GetcompIntfc(CompIntfc.INTERFACE_NAME)
&CI.KEY_FILED_NAME = ‘NEW’
If not &CI.Create () Then
Populate required fields
Else
Populate other fields
End-if;
7. Steps to test
CI?
• Using the Component Interface tester (Tools – Test Component Interface)
• Give values in the tester for options
• Get Existing, Create new, Find and perform the operation from the CI Tester
Function CheckErrorCodes()
&PSMessages = &Session.PSMessages;
&ErrorCount = &PSMessages.Count;
For &i = 1 To &ErrorCount
&ErrorText = &PSMessages.Item(&i).Text;
&ErrorType = &PSMessages.Item(&i).Type;
End-For;
End-Function
12. WHEN SHOULD I BE USING A COMPONENT INTERFACE?
If you need to insert/update/delete data through PeopleCode, and your PeopleCode
will require replicating a lot of existing business logic that already exists in a
component then a component interface is the best approach. Once you learn how to
use them, they will be the fastest and most robust solution for such cases. If you are
performing simple changes, then using a CI becomes overkill as there is an
overhead to using a CI on both the system and on development time. Similarly, large
amounts of batch processing may be too much for a CI to handle or may be
considerably slower using a CI.
13. When I create my component interface, why can't I see any Getkeys?
The search record for your component does not have any search keys defined. Go
back and define search keys as these are used as Getkeys.
15. When I test my component interface, why do I get a "Not Authorized" error?
Check that your component interface is included in a permission list that you have
access to. Also check that you have access to all possible methods (Get, Save,
Create, Cancel, Find). If you delete a component interface through application
designer, it is also removed from any associated permission lists so this may be
another reason why your new component interface (with the same name) is not
authorized any more.
Also, make sure you are not trying to do something in your code that the CI can't do.
For example, if your CI doesn't have a create method, you can't set security for it, so
you will get a not authorized error if you have code that attempts to perform a create.
This is because the authorization error is usually the first error to be displayed.
16. When automatically building a component interface, why are some fields
missing?
Sometimes application designer gets it wrong. For instance, if the same field exists
in scroll 1 and scroll 2, it may put the field in just one scroll level. It may also have
problems with certain key/search key/alternate search key fields between the search
record and the scroll level records. Normally you just need to check your CI and add
any missing fields.
21. The same field is in different scrolls but they do not have the same value
For example, at scroll 0 you might have the field EFFDT set to 01/01/2009. You
want the EFFDT field to get the same value in scroll 1, so you write code to set it
from the value in level 0 but it isn't working. If this is the case, check the field name
in the component interface, you may find that PeopleSoft has automatically renamed
it. For example, it might be EFFDT at level 0 but something like EFFDT_1 in level 1
of the component interface.
22. What underlying tables define security access to Component Interfaces?
The association between a permission list (CLASSID) and a component interface
(BCNAME) is stored in the PeopleTools table PSAUTHBUSCOMP.
23. What delivered role / permission give access to all the delivered CIs?
The role is Standard Non-Page Permissions. The permission list is HCSPCMPINT.
4) What the steps that you need to do in people code to invoke Component Interface?
• Establish a user section
• Get the component interface definition
• Populate the create keys
• Create an instance of the component interface
• Populate the required fields
• Save the component Interface.
&Session = GetSession();
&CI = &Session.GetcompIntfc(CompIntfc.INTERFACE_NAME)
&CI.KEY_FILED_NAME = ‘NEW’
If not &CI.Create () Then
Else
Populate other fields
End-if;
Populate the other fields
Function CheckErrorCodes()
&PSMessages = &Session.PSMessages;
&ErrorCount = &PSMessages.Count;
For &i = 1 To &ErrorCount
&ErrorText = &PSMessages.Item(&i).Text;
&ErrorType = &PSMessages.Item(&i).Type;
End-For;
End-Function;
11) What underlying tables define security access to Component Interfaces?The association
between a permission list (CLASSID) and a component interface (BCNAME) is stored in the PeopleTools
table PSAUTHBUSCOMP
13) When automatically building a component interface, why are some fields missing?
Sometimes application designer gets it wrong. For instance, if the same field exists in scroll 1 and scroll 2,
it may put the field in just one scroll level. It may also have problems with certain key/search key/alternate
search key fields between the search record and the scroll level records. Normally you just need to check
your CI and add any missing fields.
15) Explain under what scenarios you need to use component interface
If you need to insert/update/delete data through PeopleCode, and your PeopleCode will require
replicating a lot of existing business logic that already exists in a component then a component interface
is the best approach. Once you learn how to use them, they will be the fastest and most robust solution
for such cases. If you are performing simple changes, then using a CI becomes overkill as there is an
overhead to using a CI on both the system and on development time. Similarly, large amounts of batch
processing may be too much for a CI to handle or may be considerably slower using a CI.
- See more at: http://www.aired.in/2009/07/peoplesoft-component-interface.html#sthash.SqBQEEii.dpuf