UPDATE (20 Jan 2020) : The answer is at the end in the video.
It's been a while since PeopleCode Friday last appeared from me so here's a fun one to keep you on your toes!
The component processor is a powerful engine and it follows some well defined logical rules. Have you seen this useful flow diagram before? (sorry ... can't credit the author of this as I don't know who wrote it). It may help you to answer the question below along with the PeopleCode Event guide here.
A Component has 2 Pages.
Both Pages have PageActivate PeopleCode. Both code blocks update the &msg variable.
During the Component Post-Build event we execute a TransferPage to GRS_PA_2. (The 2nd page in the Component).
It's been a while since PeopleCode Friday last appeared from me so here's a fun one to keep you on your toes!
The component processor is a powerful engine and it follows some well defined logical rules. Have you seen this useful flow diagram before? (sorry ... can't credit the author of this as I don't know who wrote it). It may help you to answer the question below along with the PeopleCode Event guide here.
Scenario:
Both Pages have PageActivate PeopleCode. Both code blocks update the &msg variable.
During the Component Post-Build event we execute a TransferPage to GRS_PA_2. (The 2nd page in the Component).
Question ???
So the big question is ....What Happens! We know that the TransferPage during PostBuild will cause the 2nd page in the component to be displayed... So... between the transfer being initiated and page 2 being displayed what happens ?
(A) Does Page Activate fire only on Page 1 ?
(B) Does Page Activate fire only on Page 2 ?
(A) Does Page Activate fire only on Page 1 ?
(B) Does Page Activate fire only on Page 2 ?
(C) Does Page Activate fire on both Page 1 & Page 2
(D) Or does something else happen ?
UPDATE 20 January 2020: Thanks to everyone who looked at this and contributed an answer below. And now.... for the big reveal.... The answer is ..... (watch the video)
Comments
Because PostBuild fires before PageActivate. If a transfer to Page 2 occurs in PostBuild, then Page 1 is never activated.
That is my theory. Waiting to hear the answer and secretly hoping that it is not a trick question!! :)
In theory if I am correct then if you created a component with three pages (with the transfer going to Page 3). Then we have Page 1 hidden, it would execute Page 2 activate (Source) then Page 3 activate (Destination).
The flowchart is an interesting insight.