Page data is inconsistent with database (18,1)

"Page data is inconsistent with database (18,1)"

I recently came across this during a call to a Component Interface, CI.HCR_PERSONAL_DATA_SRV, that interfaced with a rather large Component, Component.PERSONAL_DATA.

(Interestingly when I tested the CI stand-alone it worked fine, never figured out why/no time.
)

I created a Project that contained *all the objects for Component.PERSONAL_DATA. This can take some time if each page has sub-pages, and in turn they too have sub-pages. Be sure to include each record for each page, and each record's associated PeopleCode.
See this post about how to do a lot of this via a SQL script or similar.

I first checked that all the tables and views for the component had been built correctly after a recent patch. They were fine.

Next I checked PeopleCode, namely SavePreChange and SavePostChange as these are the events most likely to cause the given error. Recall that this error happens when data in the buffer pre save and data in the database post save do not match. I simply went through each piece of code and remarked out likely looking code or entire sections...

...until the error stopped occuring. This pointed me to some custom code on SavePost that was updating a row via SQLExec on table x, new delivered code from the patch was updating table x in the buffer in SavePre. Thus the error. All-in-all took me a lot longer than it took to write this post.

Inserting PeopleCode into Project via Script

Sometimes you want to do big compares between environments, and you've got a rather large component, say Component.PERSONAL_DATA, and you've gone through and manually inserted all the pages, subpages, subpages-subpages and so on, including all the Records.

But doing this hasn't automatically inserted all the Record PeopleCode! Yuck, you have to go through each record... and ... no!!!

Now I've written this I can see it wouldn't be much of a leap to expand on this script to be able to just pass in a Component name. I'll leave that to you.

This script will insert all Record PeopleCode for all the Records in a given Project. Note you may have to clear you PeopleTools cache after you've run the script to see it in the given Project.


INSERT INTO PSPROJECTITEM
(SELECT DISTINCT
'PROJECT_NAME', 8
, OBJECTID1, OBJECTVALUE1, OBJECTID2, OBJECTVALUE2, OBJECTID3, OBJECTVALUE3, OBJECTID4, OBJECTVALUE4
, 0, 0, 0, 0, 1, 0
FROM PSPCMPROG
WHERE OBJECTVALUE1 IN
(SELECT OBJECTVALUE1
FROM PSPROJECTITEM
WHERE PROJECTNAME = 'PROJECT_NAME'
AND OBJECTTYPE=0));

PeopleSoft 9.1 and PeopleTools 8.50

What's new? Quite a lot. The first ten minutes is a summary of how well Oracle/PeopleSoft is doing. Skip this for a demonstration of the new technology, namely DHTML and AJAX. It is really nice to finally see some examples in an ERP. Doesn't appear to be much in the way of PeopleCode though, not like the jump to 8 for example.