Question
Accenture
US
Last activity: 23 Jul 2020 7:50 EDT
Finding the Length of an Embedded PageList
I have a pagelist BudgetInformation, BudgetYear and embedded Pagelists Equipment Personnel etc as shown below.
Can you please SHOW me how I can find the length of Equipment Pagelist?
***Moderator Edit-Vidyaranjan: Updated Platform Capability***
-
Likes (1)
Siegfried Perkles -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
IN
Hi,
You can use the 'LengthOfPageList' function under the Utilities Library or 'SizeOfPropertyList' function under the Utilities Library or Count function under Default Library to get the size of pagelist property.
Regards,
Vikash
Accenture
US
Hi Vikash,
Can you please SHOW me how to use the function?
My Equipment Pagelist in embedded on the BudgetYear Pagelist which itself is present in the BudgetDetails class.
I can multiple years, so I need to calculate the size of the Equipment dynamically and I was thinking of passing the year as a parameter.
Also the Equipment Pagelist itself can have another pagelist. So it is a three level pagelist. If I can find the size of my Equipment pagelist dynamically, I have a reference to that list and I can find the other Pagelists on the Equipment Pagelist.
Hope you understand my requirement. Looking at my clipboard, can you please show me HOW to use the function.
Updated: 23 Jul 2020 7:50 EDT
Solventek
IN
Yes show me the clipboard
Accenture
US
I tried using it like this
@LengthOfPageList(pyWorkPage.BudgetInformation.BudgetYear(param.CurrentYear).Equipment) and I was able to get the size when param.CurrentYear is an Integer.
But when I use @LengthOfPageList(.BudgetYear(param.CurrentYear).Equipment) , it doesn't work.
My DT that is calling the above, is in the BudgetInformation class itself. UNLESS I give complete reference including pyWorkPage and then BudgetInformation, it does not give the size of the list.
Why is the context not being picked up? Any ideas?
Pegasystems Inc.
IN
When you run this function it needs a page where the list is present in the clipboard.
.BudgetYear page list should be passed in the function with some page reference of the clipboard as the data will be in some page in the clipboard.
Just like how the data is in pyworkpage (in pyworkpage you have a pagelist which will have multiple pages).
Areteans Tech
AU
Hi ChakriP8,
From your statement , i can understand that there are three pagelist .
Let's call it as FirstPagelist , SecondPagelist , ThirdPagelist
So the page structure will be as shown in Image
Now , if you are in work context and want to find the Length of Third Pagelist . You have to send #firstpagelist_index and #secondpagelist_index as follows
@LengthOfPageList(.FirstPageList(Param.1stIndex).SecondPageList(Param.2ndIndex).ThirdPageList)
Now , if you are already in the FirstPagelist context and want to find the Length of ThirdPagelist , you have to pass #secondPagelist_index as follows
@LengthOfPageList(.SecondPageList(Param.2ndIndex).ThirdPageList)
There is no need of pyWorkPage reference in the DT as it will automaticallly take the Current Context (try using Primary is Required)
Let us know if it works.
Accenture
US
Thanks for your reply. My context is not being picked up at run time. What can be the issue? How can I debug CONTEXT issues? I am unable to find the value unless I give the complete path i.e. @LengthOfPageList(pyWorkPage.BudgetInformation.BudgetYear(param.CurrentYear).Equipment),.
Areteans Tech
AU
can you please provide a screenshot or document with the Data transform and Pagelist Properties