Wednesday, January 22, 2014

Menu Name on Component Interfaces

When creating a component interface be sure to set your Menu Name property to the Component your are trying to update.  For instance we built a component interface for an onboarding feed that would update new employee's federal tax withholding and their marital status, however we discovered that is was also erronously updating the unemployment jurisdiction as well.  When we traced the issue we disovered that there was PeopleCode evaluating the menu name and setting a work field called UI_JURIS_SUM, this field was not getting set via the CI.  See Below:  


>>>>> Begin STATE_TAX_DATA.UI_JURISDICTION.FieldFormula level 2 row 1
1: If %Menu = MenuName."MAINTAIN_PAYROLL_DATA_(USF)" Or
Fetch Field: MENUNAME.MAINTAIN_PAYROLL_DATA_(USF) Value=MAINTAIN_PAYROLL_DATA_(USF)
Fetch Field: MENUNAME.MAINTAIN_PAYROLL_DATA_US Value=MAINTAIN_PAYROLL_DATA_US
Fetch Field: MENUNAME.MAINTAIN_PAYROLL_INTERFACE Value=MAINTAIN_PAYROLL_INTERFACE
658      11.09.15     0.000019   <<< end       Nest=01  


This made me look to the Component Interface Properties and then set the Menu Name to the Menu name of the Component I am trying to update.


Below is the PeopleCode from above, after I set the Menu Name Property on the CI.

>>>>> Begin STATE_TAX_DATA.UI_JURISDICTION.FieldFormula level 2 row 0
1: If %Menu = MenuName."MAINTAIN_PAYROLL_DATA_(USF)" Or
Fetch Field: MENUNAME.MAINTAIN_PAYROLL_DATA_(USF) Value=MAINTAIN_PAYROLL_DATA_(USF)
Fetch Field: MENUNAME.MAINTAIN_PAYROLL_DATA_US Value=MAINTAIN_PAYROLL_DATA_US
If All(STATE_TAX_DATA.STATE) Then
3:       If STATE_TAX_DATA.UI_JURISDICTION = "Y" Then
         Fetch Field: STATE_TAX_DATA.UI_JURISDICTION Value=Y
4:          DERIVED_PAY.UI_JURIS_SUM = DERIVED_PAY.UI_JURIS_SUM + 1;
            Fetch Field: DERIVED_PAY.UI_JURIS_SUM Value=0
            Store Field: DERIVED_PAY.UI_JURIS_SUM Value=1
5:       End-If;
8: 
<<< end       Nest=01  STATE_TAX_DATA.UI_JURISDICTION.FieldFormula Dur=0.000417 CPU=0.000000 Cycles=20

So if you want your Componet Interface to behave more like you Component, then make sure you set your menu property!