Calling a section from a Class branch that is not in the inheritance path
I a have a class ABCD which has two (child) branches AB and CD. In the AB branch, I have a child class ABX. In this child class ABX, I have section SectionY. This SectionY includes other sections that have been defined in class ABX and AB.
My requirement is as follows. I need to embed/call a section (SectionP) that has been defined in class CD in the SectionY that has been defined in class ABX. (and hence SectionY and SectionP are not related via inheritance).
To accomplish this, I drag the required section from the Class Explorer Menu (SectionP) onto my SectionY. At the point PEGA gives me a pop up (attached) saying
Pick or add Page and Class
Your property SectionP is not part of class ABCD-AB-ABX and asks me to add the pageName of the Class of SectionP.
(not sure why PEGA uses the word 'property' for the section I am trying to embed)
After adding the pageName 'CDPage', I am able to save and run it. But SectionP is not available on SectionY.
I checked the clipboard and am unable to find the pageName 'CDPage' which is probably why the SectionP is not visible inside SectionY.
I have checked the SectionInclude properties and the PageContext property is set to use the ClipBoard.
What am I doing wrong?
***Updated by moderator: Lochan to update Categories***
You are correct, you need that page to exist. What you did was define at design time what the clipboard is supposed to look like. If it doesn't look that way at run time, you will have problems. Why do you want a section defined in an unrelated class if you don't have an object of that class with data you want to display? Are you planning on adding data to it? If not, why don't you move the section up to class ABCD, so that it is available to all the subclasses?
You need to analyze why the clipboard property pageName 'CDPage' is missing in the first place as this a run time error. On the clipboard there is a facility to ADD and Delete a new page. Add the 'CDPage' and test it. To Mike's point there will be many scenarios and various reasons to have section defined in an unrelated class if you don't have an object of that class with data. For example:- a dropdown list of state counties defined deep within a Data Class that you might need to show in an unrelated Work class. It will not always be possible to use a single inheritance from parent class ABCD.
Your solution worked. On the clipboard, in the work object (pyWorkPage), on ABX class, I defined an instance or page of type class CD. I added a page of type 'CDPage' and a property defined in class CD that is present on Section P. The Section P was visible on on Section Y even though Section P is not available in the inheritance Section Y. So all I need to do is make sure that the CDPage (of type CD class) is available in the pyWorkPage of ABCD-AB-ABX workobject. How can I do this at run time?