Showing posts with label Property in Pega. Show all posts
Showing posts with label Property in Pega. Show all posts

Thursday, 26 March 2020

Count In Page List Pega expression


Count In Page List Pega expression

Hi Friends, today we will practice the Page List expression provided in the below Pega help URL.

https://community.pega.com/sites/default/files/help_v718/definitions/p/pagelist.htm

Wrote a sample activity in work class to browse the list of pages from Courses data class.



Courses Data table


countInPageList(LookFor, LookAt, LookIn)


This expression will provide the Match count . 

LookIn- PageList name in which we want to search.
LookAt- which property we have to search for value.
LookFor - Value what we have to search in the Property.


Now If I want to get the Number of records having Hours = 2 , then I will use this expression .
 



From the table we can see for 4 records hours is 2.

In Property-Set added expression to get the count of pages which having hours 2.

Value will return in Count Parameter.


Lets run the activity and check the result in Parameter page.

Activity ran and traced 


In Event Line 7, we will check the parameter page.

We can see the result as 4 in Count Parameter.

countInPageListWhen(WhenName, LookIn)


This expression little bit same as above expression. 

WhenName - We can use the when condition to evaluate the data in the Current Page of PageList.
                       If the when condition becomes true then count will increase by 1.

LookIn- PageList name in which we want to search.


In acitivity added the expression, If when condition SalesDepartment becomes true then count will increase by 1.




When Condition

This when condition becomes true when current page in page list have department contains Sales.

Lets run the activity and check it.

In the tracer we can see when condition became true for record 9 and 10. So Count should be 2.


Result:

Count is 2.



other expression will see in next post. Ask in comment if you have any doubt😊

Saturday, 14 March 2020

Linked Property in Pega

Linked Property in Pega

Reference:

PDN help url

We have video about linked property on Pega course  PRPC: USER EXPERIENCE SPECIALIST .


In this Post we will see how to Use Linked property.

Why we have to use linked property?

Assume we have 2 Cases One is to get Customer Information and another one is to process purchase request.

When processing get Customer Information case we will get all the information about Customer like Personal Information about customer, Card Information, etc.


When Processing Purchase Request case we will get Information about What he is going to Purchase like Product Name, Quantity, etc.

Our requirement is to display Customer Information in Purchase request case. So what we will do to achieve this?
We will open Customer Information Case in Purchase request case using Activity then we will display the information.
Declare page we can use.

These may affect application performance because we are using activity to open the Customer Case .Pega provides Liked Property to reduce these complexity.


How Linked Property works:

We have two Case: Customer and Purchase. We can access customer class instance using a purchase class property that property is Linked Property( I.e, CustomerID).

Created a flow in Customer Class to get customer Information.





And its section.


Similarly created a flow in Purchase class

When we select CustomerID(Linked Property) in Purchase request case, we are refreshing the whole section . In below dynamic layout we are showing Customer Case firstname, lastname, cardnumber, cvv using Linked property.

Linked Property Configuration : CustomerID Property in Purchase request class is mapped to Customer class for that class key is pyID of Purchase Request.

Mapped Customer class LastName property in Purchase request class using CustomerID Linked Property. 

Similarly mapped Customer class FirstName property in Purchase request class using CustomerID Linked Property.

When we provide CustomerID(pyID) which is available in Customer class the corresponding Customer class instance will be opened and we can able to access whole instance using this CustomerID Property.

Assume we are providing a CustomerID in Purchase Request case, If the provided CustomerID is available in Customer class table then it is a Linked Page Hit, or else it is a Linked Page Miss.

Run the flow and check it.

Created a customer case (C-171)



Created a Purchase Case. Our expectation is on Selecting the CaseID corresponding Customer FirstName, LastName , CardNumber and CVV should populate

Tracing while changing the value.



C-171 is available in customer class so Liked Page hit


We are displaying C-171.FirstName, C-171.LastName, C-171. CardNumber, C-171.Cvv in below section.


We can see the Successful hit pages in Linked Property Pages in Clipboard.

Linked Property clipboard Page will remove on Commit.

Please ask if you have any doubt in comment.😊