Wednesday 29 August 2018

Primary Page in pega

Use of Primary Page in pega


In most of the case we will use Primary page in pega activity. What is the use of Primary page and why we have to use primary page???

Primary page is a page in pega, which refer to the current rule class name.

Now our requirement is to get the employee details for the given employee id. 

How to acheive this?? First we have to create one flow in that flow , in first section we have to get the employee id . In action tab of EmployeeID property we have to post the value to clipboard and then call one activity in that activity we have to use obj-Browse method to get the employee details. 

Lets see how to achieve this.

Our flow look likes

Our section look likes


In the First Dynamic layout we have one Employee ID property to get the employee id . On change we have to post the value to clipboard and then call one activity.



U can ask , Y we have to use Post Value , the answer is to post the property value to clipboard.  Now in our scenario. Once I changed the EmployeeId property with some value that value will be send to clipboard using this Post Value.


Then on change of value in EmployeeID property we are calling one activity "RetrieveEmpDetails"

there we retrieve employee details.

Now In first step , I created Page-New step to create one page in clipboard with name TempEmpDetails.

TempEmpDetails refer to class where my local data table is there.


In second step, I added Obj-Browse, to retrieve values,

Now I used page Primary. in this time primary refer to "TGB-HRApps-Work", as I told already Primary == class of the rule.(activity is in class TGB-HRApps-Work)

So in run time EmpID is refered from pyWorkPage , this is because pyWorkPage is also refer the current rule class .

Now we run once our flow and check whether our activity works fine or not.


Now lets run the flow.

Now I gave 2 in employee id field. so now see our clipboard whether TempEmpDetails have value or not.


So its working.  I think U understand how to use Primary Keyword in pega activity. Primary refer to class of the rule.

If any Doubt ask in comment 😊

4 comments:

  1. Excellent one mate

    ReplyDelete
  2. thanks for sharing there is very interesting information.I have a question what is the difference if we use .empid and primary.empid


    ReplyDelete
    Replies
    1. if we use .empid then pega will look the value of empid in current steppage, If we use primary.empid then pega will look the value of empid in the page in which activity is invoked.

      Delete
  3. Thanks for your information. very good article.
    Pega Course
    Pega Training

    ReplyDelete