Tags:
Permalink Reply by Peoplesoft Training on March 23, 2011 at 11:59am Open a file and write the error on this file. Delivered Appengines have a lot of error handling codes.When you try to save the component interfaces define error handler functions.Below is the psuedo code.
If Not &oDeptCf.Save() Then;
errorHandler();
throw CreateException(0, 0, "Save failed");
End-If;
Function errorHandler()
Local ApiObject &oPSMessageCollection, &oPSMessage;
Local number &i;
Local string &sErrMsgSetNum, &sErrMsgNum, &sErrMsgText, &sErrType;
&oPSMessageCollection = &oSession.PSMessages;
For &i = 1 To &oPSMessageCollection.Count
&oPSMessage = &oPSMessageCollection.Item(&i);
&sErrMsgSetNum = &oPSMessage.MessageSetNumber;
&sErrMsgNum = &oPSMessage.MessageNumber;
&sErrMsgText = &oPSMessage.Text;
&fileLog.WriteLine(&sErrType | " (" | &sErrMsgSetNum | "," | &sErrMsgNum | ") - " | &sErrMsgText);
End-For;
rem ***** Delete the Messages from the collection *****;
&oPSMessageCollection.DeleteAll();
End-Function;
Please contact us at g_konar@rediffmail.com or 91-9741420569 for online training
Permalink Reply by Adam Langley on June 14, 2011 at 3:13pm I have not found a way to do this gracefully in any CI. Invalid values cause it to fail so what I do is this for a particularly problematic field: find the table or view that field is validating against on the record and inside a condition populate it only if it passes a SQLExec validation using the value first.
For example:
SQLEXEC("SELECT 'X' FROM PS_the_validation_view WHERE the_field =:1, &the_field_value, &EXISTS);
If &EXISTS='X' then
&oPosition_Data.my_field=&the_field_value;
else
MessageBox(0, "", 0, 0, "ERROR: The Position " |&oCiPositionData.POSITION_NBR|" has an invalid value of: " |&the_field_value | " for the field the_field.");
end-if;
I wish Oracle would make a simpler way to handle an invalid value without it stopping all processing.
© 2012 Created by PSoftPros.
