Posted by Nitin Pai
December 18th, 2008

Hi,

This is a very basic question, but I’m not 100% sure about it.

Which code should be written in SavePreChange & which in SavePostChange event?

I’m not able to fully differentiate between these two events.

Thanks

Thanks for posting your question!

Any code that requires a database insert/update/delete and/or data validation should be written on SavePreChange.

SavePostChange is usually used to fire workflows or trigger AAF events. Code that modifies the fields on that component should never be written on SavePostChange as it tends to garble up the component buffer.

SavePostChange

You can use SavePostChange PeopleCode for processing that must occur after the database update, such as updates to other database tables not in the component buffer.

Additional Examples:

§ Cleaning up the temporary tables after successful validation of the changes.

§ Insert into custom audit records

Thanks

Rahul Seth

Nitin Pai

How can I find all the roles and the records that the roles can access using Query Manager?

Thanks!

Thanks for posting your question!

You can use the below SQL.

SELECT DISTINCT B.CLASSID, A.ROLENAME, B.TREE_NAME, C.TREE_NODE “RECORD”

FROM PSROLECLASS A, PS_SCRTY_ACC_GRP B, PSTREENODE C

WHERE A.CLASSID = B.CLASSID

AND B.TREE_NAME = C.TREE_NAME

AND C.EFFDT =

(SELECT MAX(C_ED.EFFDT) FROM PSTREENODE C_ED

WHERE C.SETID = C_ED.SETID

AND C.SETCNTRLVALUE = C_ED.SETCNTRLVALUE

AND C.TREE_NAME = C_ED.TREE_NAME

AND C_ED.EFFDT <= SYSDATE)

AND C.TREE_NODE_TYPE = ‘R’

AND B.ACCESSIBLE = ‘Y’

ORDER BY 1,2,3,4;

Thanks

Nitin Pai

Comments (0)