Quantcast
Channel: Web Service Help
Viewing all articles
Browse latest Browse all 248

(no title)

$
0
0

Hi Bob this is the code ….Its working fine in ON Server intance..when i move to other testing instance i am getting that error…

rem Local File &fileLog;
Local ApiObject &oSession, &oTmPrEasyCi;
Local ApiObject &oTmPrPrdtVwCollection, &oTmPrPrdtVw;
Local ApiObject &oTmPoReqLineCollection, &oTmPoReqLine;

Function errorHandler()
Local ApiObject &oPSMessageCollection, &oPSMessage;
Local number &i;
Local string &sErrMsgSetNum, &sErrMsgNum, &sErrMsgText, &sErrType;
MessageBox(0, " ", 0, 0, "Hi");
&oPSMessageCollection = &oSession.PSMessages;
For &i = 1 To &oPSMessageCollection.Count
&oPSMessage = &oPSMessageCollection.Item(&i);
&sErrMsgSetNum = &oPSMessage.MessageSetNumber;
&sErrMsgNum = &oPSMessage.MessageNumber;
&sErrMsgText = &oPSMessage.Text;
MessageBox(0, " ", 0, 0, &sErrMsgText);
rem &fileLog.WriteLine(&sErrType | " (" | &sErrMsgSetNum | "," | &sErrMsgNum | ") - " | &sErrMsgText);
MessageBox(0, " ", 0, 0, &sErrType | " (" | &sErrMsgSetNum | "," | &sErrMsgNum | ") - " | &sErrMsgText);

End-For;
rem * Delete the Messages from the collection *;
&oPSMessageCollection.DeleteAll();
End-Function;

try
rem * Set the Log File *;
rem &fileLog = GetFile("C:\Users\nm107448\AppData\Local\Temp\TM_PR_EASY_CI.log", "w", "a", %FilePath_Absolute);
rem
&fileLog.WriteLine("Begin");
rem * Get current PeopleSoft Session *;
&oSession = %Session;

rem * Set the PeopleSoft Session Error Message Mode *;
rem * 0 - None *;
rem * 1 - PSMessage Collection only (default) *;
rem * 2 - Message Box only *;
rem * 3 - Both collection and message box *;
&oSession.PSMessagesMode = 1;

rem * Get the Component Interface *;
&oTmPrEasyCi = &oSession.GetCompIntfc(CompIntfc.TM_PR_EASY_CI);
If &oTmPrEasyCi = Null Then
errorHandler();
throw CreateException(0, 0, "GetCompIntfc failed");
End-If;

rem * Set the Component Interface Mode *;
&oTmPrEasyCi.InteractiveMode = False;
&oTmPrEasyCi.GetHistoryItems = True;
&oTmPrEasyCi.EditHistoryItems = False;

rem * Set Component Interface Get/Create Keys *;
&oTmPrEasyCi.BUSINESS_UNIT = TM_PRMOB_AET.BUSINESS_UNIT.Value;
&oTmPrEasyCi.REQUESTOR_ID = TM_PRMOB_AET.REQUESTOR_ID.Value;
&oTmPrEasyCi.REQ_ID = TM_PRMOB_AET.REQ_ID.Value;

rem * Execute Get *;
If Not &oTmPrEasyCi.Get() Then
rem * No rows exist for the specified keys.*;
errorHandler();
throw CreateException(0, 0, "Get failed");

Else
MessageBox(0, " ", 0, 0, "GET Method");
End-If;

MessageBox(0, " ", 0, 0, "PR_APPROVE" | TM_PRMOB_AET.PR_APPROVE.Value);
rem &fileLog.WriteLine(TM_PRAPP_WRK.PR_APPROVE.Value | " ok ");

If TM_PRMOB_AET.PR_APPROVE.Value = "Y" Then

&oTmPrEasyCi.APPROVED = "Y";

MessageBox(0, " ", 0, 0, "CI approved" | &oTmPrEasyCi.APPROVED);
&oTmPrEasyCi.TM_PR_REMARK = TM_PRMOB_AET.TM_PR_REMARK.Value;

MessageBox(0, " ", 0, 0, "TM_PR_REMARK :" | TM_PRMOB_AET.TM_PR_REMARK);

End-If;

If TM_PRMOB_AET.PR_APPROVE.Value = "N" Then

&oTmPrEasyCi.deny_flag = "Y";

MessageBox(0, " ", 0, 0, "CI denied" | &oTmPrEasyCi.deny_flag);

&oTmPrEasyCi.TM_PR_REMARK = TM_PRMOB_AET.TM_PR_REMARK.Value;
MessageBox(0, " ", 0, 0, "TM_PR_REMARK :" | TM_PRMOB_AET.TM_PR_REMARK);
rem &fileLog.WriteLine(TM_PRAPP_WRK.TM_PR_REMARK.Value);

REM &fileLog.WriteLine(&oTmPpapprCi.TM_PR_REMARK);
End-If;

rem * Execute Save *;
If Not &oTmPrEasyCi.Save() Then;
MessageBox(0, " ", 0, 0, "error");
errorHandler();
rem
throw CreateException(0, 0, "Save failed");

rem
&fileLog.WriteLine("Save failed tata");

Else

MessageBox(0, " ", 0, 0, "SAVE");

MessageBox(0, " ", 0, 0, "TM_PR_REMARK SAVE :" | TM_PRMOB_AET.TM_PR_REMARK);

End-If;

rem * Execute Cancel *;
If Not &oTmPrEasyCi.Cancel() Then;
errorHandler();
throw CreateException(0, 0, "Cancel failed");
End-If;
<*
catch Exception &ex
rem Handle the exception;
rem &fileLog.WriteLine(&ex.ToString());
*>
end-try;
rem &fileLog.WriteLine("End");
rem &fileLog.Close();


Viewing all articles
Browse latest Browse all 248