This Post is about the Database query useful in pega and how to use them.
Everytime we need to deploy code to higher environment , we need to do certain validations to make sure all the rules are deployed and no retrofits are needed.this post is going to help me with the database queries in single page.
Click the button to copy the syntax
| Function | To check if value exist in Pagelist |
|---|---|
| Syntax | |
| Notes | Return true, if the value that has been passed as input is in the property that is in pagelist exist and false otherwise For example: @IsInPageList("ApplyJobs","pyLabel",D_ABC.pxResults) @IsInPageList("Jon Snow","Name",.CandidateList) @IsInPageList(.pyUserName,"Name",.CandidateList) |
| Function | check if any of the page has the match |
|---|---|
| Syntax | |
| Notes | Returns true, when any of the page has the match. For example: @IsInPageListWhen("IsAvailable",D_ABC.pxResults) @IsInPageListWhen("IsAvailable",.CandidateList) |
| Function | To get count if value exact match with property in Pagelist |
|---|---|
| Syntax | |
| Notes | Returns count of the pages which has the match. For example: @countInPageList("ApplyJobs","pyLabel",D_ABC.pxResults) @countInPageList("Jon Snow","Name",.CandidateList) @countInPageList(.pyUserName,"Name",.CandidateList) |
| Function | To get count of Pagelist matching when condition |
|---|---|
| Syntax | |
| Notes | Returns count of the pages which has the match. For example: @countInPageListWhen("IsAvailable",D_ABC.pxResults) @countInPageListWhen("IsAvailable",.CandidateList) |
| Function | To check if on all pages contains exact match with property in Pagelist |
|---|---|
| Syntax | |
| Notes | Return true, if on all pages contains exact match with property in Pagelist \ For example: @IsInEachPageofList("ApplyJobs","pyLabel",D_ABC.pxResults) @IsInEachPageofList("Jon Snow","Name",.CandidateList) @IsInEachPageofList(.pyUserName,"Name",.CandidateList) |
| Function | To check if on all pages in Pagelist Pagelist matching when condition |
|---|---|
| Syntax | |
| Notes | Returns true, if the when condition evaluates to true for every page of the pagelist. For example: @IsInEachPageofListWhen("IsAvailable",D_ABC.pxResults) @IsInEachPageofListWhen("IsAvailable",.CandidateList) |
| Function | To check the length of Pagelist |
|---|---|
| Syntax | |
| Notes | Returns Length of the pagelist. For example: @LengthOfPageList(D_ABC.pxResults) @LengthOfPageList(.CandidateList) |
| Function | Get the index in Pagelist |
|---|---|
| Syntax | |
| Notes | Returns the index of the first entry in the pagelist. Returns -1 if no match found. For example: @IndexInPageList("ApplyJobs","pyLabel",D_ABC.pxResults) @IndexInPageList("Jon Snow","Name",.CandidateList) @IndexInPageList(.pyUserName,"Name",.CandidateList) |
| Function | Get the index in Pagelist, if any of the page has the match |
|---|---|
| Syntax | |
| Notes | Returns the index of the first entry in the pagelist , when any of the page has the match. Returns -1 if no match found. For example: @IndexInPageListWhen("IsAvailable",D_ABC.pxResults) @IndexInPageListWhen("IsAvailable",.CandidateList) |
| Function | check value of one property on each page of the Page List with the operand and value specified |
|---|---|
| Syntax | |
| Notes | Option_here can be ANY/ALL. Does not create any additional pages.
Returns true if all/any of the values meet the comparison. Returns false if the property contains no pages For example: @entrySatisfiesCondition(.Invitees().age, ">", 45, "ANY") |
| Function | To sort the pagelist based on property |
|---|---|
| Syntax | |
| Notes | Option_here can be Ascending/Descending..
Returns sorted order in the same pagelist For example: @pxSortPageList(CaseType.pxResults,".pyCaseTypeClass","Ascending") |





