Hi All
we have encountered an issue with the Page.Activate event and saving data. We have resolved the issue and I'd like to post our solution. I have searched for the issue on this site and can not see anyone asking for help however appologises nonetheless for repetition if this situation has been covered.
Page PeopleCode events only permits a DML SQL commands (Insert,Delete...) to called particular circumstances. These events are well documented - look for PeopleBooks Component Process workflow Post Change, Save Change etc.
Well we wanted to created a new row of data in a log table when a user lands on a page.
The only event triggered in this case would be Page.activate.
But Peoplesoft Architecture was preventing us from issuing a SQLExec command
ie SQLEXEC ("Insert into %Table(A_Record) (Column1) values ('A')" ) ;
or
via The record Insert command
&MyRec = CreateRecord(Record.A_TABLE)
&MyRec.Column1.value = "A";
&MyRec.Insert();
So the solution here was to write a Application Engine eg "UD_Insert_Data_AE".
Create a new step and SQL action.
Write your SQL to insert the value - eg
Insert into %Table(A_Record) (Column1) values ('A')
Leave the Commit Action to the default.
Save your Application Engine,
Then- go to PeopleSoft and create a Process for your new appEngine and assign the values:
Component = PRCSMULTI
Process Groups = ALLPAGES
Then Finally kick the Application Engine from the Page.Activate peoplecode:
CallAppEngine("UD_Insert_Data_AE");
Hope this helps.
Pwauly
| Title | Under | Posted on |
|---|---|---|
| how to create application status in peoplesoft campus solutions 8.9 version | PeopleSoft Functional | 05/17/2012 - 4:09am |
| horizantal text in charts | PeopleSoft Technical | 05/10/2012 - 4:57am |
| no current buffer context error | PeopleSoft Technical | 05/10/2012 - 1:19am |
| Integration Broker : Operating Instance/Pub Contracts/Sub Contracts | PeopleSoft Technical | 04/24/2012 - 11:05am |
Hi Again -
Feel to ask questions about the above post.
Thanks
Pwauly
pwauly, did you try using save() or savenow() functions in the page activate code and then have your insert statement on some save peoplecode event? I would imagine that to be better than calling an application engine.
Thanks for sharing your solution though, I truly appreciate it.
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog
Hi Lepa
thanks for the feedback. No we had not initially tried using the functions Do Save or DoSaveNow() on the Page.Activate event and have the SQL business-end on a PostSave event.
I have tried this method and found it not to succeed due to the PS restrictions placed on the use of these functions.
IE We witnesed this error:
"Built-in function DoSave cannot be called from Other PeopleCode (180,182) UD_TEST_PAGE.Activate PCPC:31 Statement:1
The specificed built0in function has restrictions on what types of PeoplCode programs it may be used in. It has been used in a program that violates these restrictions.
Review and rework the PeopleCode toremove the violation. " OK
This message is also displayed when DoSaveNow(); is used.
So thanks for the suggestion and yes I agree that the use of an application engine for this case could be deemed overkill but so far it been entirely neccessary - and so far the only successful method.
Thanks
Pwauly
I think we can do this through publishing message from Page Activate .
I agree with Hari, publishing a message would be better. It's worth giving a try.. :)
Thanks for the PS message suggestion - i'll give it a whirl. Cheers
pwauly,
Did try publishing message? did it work?
Hi RR_2011
no I didn't try the messaging technique that was proposed by an earlier post. I take it you're trying to implement something like this? Are you encountering any issues?
Thanks
Pw
Hi pwauly,
It works. Publishing Async message from Page activate works. have no issues.
if you get a chance try it out and let me know if you have any questions and I will be glad to asnwer them.
Good post.
RR_2011
Post new comment