Component interface does not save errors

Hello

I'm reading a series of JOB of lines from a flat file and calling the CI_JOB_DATA (component is JOB_DATA) App Engine peoplecode and on record, he seized any errors. It does for some employees, but does not account for some employees. I tried for the %Session.ErrorPending property to check if there are errors even on back successfully, then calling rollback and errorhandler function if there are errors, but it always saves the line with errors.

Don't know what Miss me, please help.

Input file

--------------

Type Rec, Emplid, Effdt, Action, right of Action

ARE, 000001386, 15/03/2015, TER, ATT

, 000001620, 15/03/2015, TER, RETIRED

PR, 000001732, 15/03/2015, PAY, PRR, 30

AE PeopleCode

Function errorHandler()

Local ApiObject oPSMessageCollection & oPSMessage;

Local number & J;

Local string sErrMsgSetNum, sErrMsgNum, sErrMsgText & sErrType;

& oPSMessageCollection = & Session.PSMessages;

& ErrString = "";

J = 1 & at & oPSMessageCollection.Count

& oPSMessage = & oPSMessageCollection.Item (& J);

& sErrMsgSetNum = & oPSMessage.MessageSetNumber;

& sErrMsgNum = & oPSMessage.MessageNumber;

& sErrMsgText = & oPSMessage.Text;

MessageBox (0, "", 0, 0, "CI error/warning:" |) & sErrType | " (" | & sErrMsgSetNum | "-" | & sErrMsgNum | ") - " | & sErrMsgText | """");

If None(&ErrString) then

& Sep = "";

On the other

& Sep = ",". " » ;

End - If;

If find ("Error", & sErrMsgText) > 0 Then

If Len (& ErrString | & Sep | & sErrMsgText) < = 254 then

& ErrString = & ErrString | & seven | & sErrMsgText;

End - If;

End - If;

-End;

End-function;

/*************MAINLINE *********************/

& StgRs = CreateRowset (Record.STAGE_REC_TBL);

& StgRs.Fill ("WHERE IND ('P', 'n') AND REC_TYPE <>'BT' ORDER BY ORDERNO" ""); / not read the error lines * /.

If All (& StgRs (1).) STAGE_REC_TBL. EMPLID. Value) then

I = 1 & at & StgRs.RowCount

Try

& session = Session %;

& Session.PSMessagesMode = 3;

If & <>Null Session can

& JobDataCI = & Session.GetCompIntfc (CompIntfc.CI_JOB_DATA);

If & JobDataCI = Null Then

Throw CreateException (0, 0, "GetCompIntfc failed");

Exit (1);

End - If;

& JobDataCI.InteractiveMode = True;

& JobDataCI.GetHistoryItems = True;

& JobDataCI.EditHistoryItems = False;

& StgRec = & StgRs (& i). GetRecord (Record.STAGE_REC_TBL);

& Emplid = & StgRec.EMPLID.Value;

& JobDataCI.KEYPROP_EMPLID = & Emplid;

& JobDataCI.KEYPROP_EMPL_RCD = 0;

MessageBox (0, "", 0, 0, "employee treatment:" |) (& Emplid);

CommitWork();

In the case opposite & JobDataCI.Get () then

Throw CreateException (0, 0, "Get failed");

End - If;

& oCollJobCollection = & JobDataCI.COLL_JOB;

ColNo = & oCollJobCollection.GetEffectiveItemNum (String (& StgRec.EFFDT_NEW. Value), 1);

If & ColNo > 0 Then

& oCollJobItem = & oCollJobCollection.item (& ColNo);

If & oCollJobItem.KEYPROP_EFFDT = & StgRec.EFFDT_NEW. Value then

SQLExec ("SELECT PS_JOB_ALL_CURR_VW WHERE EMPLID = EFFSEQ_NOKEY + 1: 1 AND EMPL_RCD = 0", & Emplid, & SeqNo);

REM & SeqNo = oCollJobItem.KEYPROP_EFFSEQ + 1;

On the other

& SeqNo = 0;

End - If;

& oCollJobItem = & oCollJobCollection.InsertItem (& ColNo);

& oCollJobItem.KEYPROP_EFFDT = & StgRec.EFFDT_NEW. Value;

& oCollJobItem.KEYPROP_EFFSEQ = & SeqNo;

& oCollJobItem.PROP_ACTION = & StgRec.ACTION.Value;

& oCollJobItem.PROP_ACTION_REASON = & StgRec.ACTION_REASON. Value;

& oCollJobItem.PROP_DFLT_COMP_BTN = "Y";

& oCollJobItem.PROP_CALC_COMP_BTN = "Y";

& oCollJobItem.PROP_CMP_CHANGE_AMT_FLG = "Y";

Assess and StgRec.REC_TYPE. Value

When = "PR".

& oCollJobItem.PROP_COMPRATE = & StgRec.COMPRATE.Value;

& oCollCompensationCollection = & oCollJobItem.COLL_COMPENSATION;

& CompCNo = & oCollCompensationCollection.GetEffectiveItemNum (String (& StgRec.EFFDT_NEW. Value), 1);

& oCollCompensation = oCollCompensationCollection.Item (& CompCNo);

& oCollCompensation.KEYPROP_COMP_EFFSEQ = 0;

& oCollCompensation.PROP_COMPRATE = & StgRec.COMPRATE.Value;

& oCollCompensation.PROP_MANUAL_SW = "Y";

Break;

End-assess;

In the case opposite & JobDataCI.Save () then

Throw CreateException (0, 0, "failed record");

On the other

If & Session.ErrorPending then

REM SQLExec ("ROLLBACK");

REM errorHandler();

End - If;

/ * If & Session.ErrorPending then

In the case opposite & JobDataCI.Cancel () then

MessageBox (0, "", 0, 0, "Cancel CI failed");

End - If;

Throw CreateException (0, 0, "THIS save Error (s)");

End - If;

*/

End - If;

CommitWork();

On the other

MessageBox (0, "", 0, 0, "not to mention dated the New Effdt line");

End - If;

End - If;

catch Exception & ex

errorHandler();

WARNING & ex. ToString();

end - try;

-End;

End - If;

Hi, so I tried what you are doing and I can confirm that the CI is actually saving data, even if there were errors encountered along the way. Also, I noticed that the error we get from PSMessage is actually not of any one of the fields that we are trying to update.

So I think that probably the error against EMPL_TYPE has been through a posting somewhere and has already been addressed in a code and has corrected (or adjusted) it before the real CI. Save(). This is my test by which I initialize this before field save the CI.

& oCollJobItem.PROP_EMPL_TYPE = "A";

However, the log shows that the value of this field has a value of 'n', which I assume has been updated somewhere

PSAPPSRV.3008 (429) 10.38.26 1-68247 0.000000 11: evaluate the WORK. EMPL_TYPE
PSAPPSRV.3008 (429) 10.38.26 1-68248 0.000000 Field: EMPLOYMENT. Value EMPL_TYPE = N

In addition,

1723545 wrote:

Alvin - it won't work as long as the session psmessages is not created until the recording is happening.

It seems to work for me... & oSession.errorPending returns "True" for our scenario

If & oSession.errorPending then

REM * run cancel *;

If not & oCiJobData.Cancel ();

MessageBox (0, "", 0, 0, "Cancel has failed");

errorHandler();

Throw CreateException (0, 0, "could not cancel");

End - If;

On the other

REM * run Save *;

If not & oCiJobData.Save ();

MessageBox (0, "", 0, 0, "registration failed");

Throw CreateException (0, 0, "failed record");

On the other

MessageBox (0, "", 0, 0, "Save OK");

End - If;

End - If;

Tags: Oracle Applications

Similar Questions

Maybe you are looking for

  • Firefox is still buggy after adware removal

    After removing some adware that I had yesterday, Firefox is still sort of bug. I did deep analysis in my records with multiple anti-malware and anti-virus programs. and I uninstalled Firefox, delete old profiles too and make a new clean install. Howe

  • Automatic operation of the brightness

    I have a Snugg Silicone cover for my iPad 2 Air.  When I put it on my iPad and the "Automatic brightness" control is in auto mode, the screen becomes the minimum brightness. To return to normal display to the ratings, I put the manual control to adju

  • Convert hex (or byte?) duplicate

    Hallo, I'm contacting an instrument through VISA controls. I'm getting a release in the hexagonal form combination of numbers and letters. the thing is that, with all the formulas that I tried to convert it to a double I failed miserably. The data ca

  • HP Photosmart: No black printing more

    I changed my cartridges yellow, pink and blue as they were low on ink. After this operation, all the impressions I have try to make are without any black. Theblack ink level indicates half full. I tried to rebbot the PC, the printer... moved the blac

  • BlackBerry Pearl Smartphones does not receive messages while MS Outlook is 'on '.

    I just moved my Pearl of a BES configuration company for a new account AT & T using BIS.  I finally got messages to reconcile with the BB wireless return service directories to the device. My problem - although relatively minor - is that the BB will