Question
Salame
Last activity: 21 Jul 2016 10:37 EDT
Getting last child of a defined case type
Hello,
In an activity, I need to get the last child of a defined case type, I did the following, but, I'm getting errors, can you please help?
Property-Set
Local.lastItem = @Utilities.SizeOfPropertyList(pxCoveredInsKeys) (to get the max in the vlaueList)
Property-Set
Local.newChild= @sum(Local.lastItem,1) (to get the max+1)
Please note that local variables are of type int.
Thanks,
Rosy
***Updated by moderator: Lochan to add Categories
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
PEG
IN
Hi Rosy,
In Property-Set method,iterate the loop to get the last child case value.
Loop -> For Each Embedded page
Step Page -> MyPage.pxResults
MyPage.pxResults(<LAST>).pyID -> .pyID
In Pages &Classes tab
MyPage ->Code-Pega-List
MyPage.pxResults -> Your work page class.
Hope this helps!
Salame
Hello,
Does someone have any idea how to get the last child created?
Thx,
Rosy
Accepted Solution
PEG
IN
Hi Rosy,
In Property-Set method,iterate the loop to get the last child case value.
Loop -> For Each Embedded page
Step Page -> MyPage.pxResults
MyPage.pxResults(<LAST>).pyID -> .pyID
In Pages &Classes tab
MyPage ->Code-Pega-List
MyPage.pxResults -> Your work page class.
Hope this helps!
Salame
Thanks a lot Gangababu for ur response!
It worked:D
Rosy
Areteans
AU
Can't you use <append> subscript to append at the end of the list rather than going for java?
Salame
Thanks a lot Navinda for ur response!
Rosy
Pegasystems Inc.
IN
Hi Rosy,
I would suggest you to get the list of pxCoveredInsKeys for all the subcases (child cases ) for your parent case. You can iterate it by using a symbolic index <LAST> which will retrive the highest index , take the pxCoveredInskey of that instance and use it for your usecase.
Let me know if it helps you.
Please find below the list of symbolic indexes that you can use while loop through the iteration :
<CURRENT> - Identifies the index of the current iteration
<APPEND> - Inserts the element at a new position at the end
<LAST> - Retrieves the highest index
<PREPEND> - Inserts the element at the top
<INSERT> - Inserts the element at a specific position that is indicated by the number
This might be helpful for you.
Regards,
Ravi
Salame
Thanks a lot Ravi for ur response!
It worked:D
Rosy
Pegasystems Inc.
IN
HI Rosy,
You can use below singnature to fetch the last item in value list
.pxCoveredInsKeys(<LAST>)
Salame
Thanks a lot Rajendraprasadu for ur response!
It worked:D
Rosy