Monday, May 11, 2020

Obj-Open Method in pega

Obj-Open Method:- Obj-Open method is used to retrieve a single record from the clipboard.we have explained below scenario for better understanding of obj-open method.

OBJ-OPEN

In the above screen we have some records in Local Db,Now we are going to fetch single record by using OBJ-OPEN method.

By using page list property we are using all Data class properties into work class
Work class should be look like same as shown in above pictures after using property values of data class in a work class
Create Data transform to perform Retrieve actions and set visibility condition for dynamic layout as if action=='Retrive' then only it is visible.(this is extra work if you want you can do this without data transform).
Create section 
Section's pages and classes tab,add EmpRecord page in Dhan-DhanaNet-Data-Records-EmpRecord class.

Add action Refresh-This section on the button,Add activity and add data transform to set operation as retrieve.
Now we are using obj-open method in above screen shot to fetch required record.
Refer EmpRecord page to a data class in pages and classes tab.

Now it is ready to fetch a required result from the  data base,use flow to run the all our process.
Add flow action in flow
Add section in to flow
Now run the flow and request for the required result
Result has been fetched and displayed on UI.

If you have doubt ask in comments.

Sunday, May 10, 2020

Obj-Save methods in pega

Obj Save methods in Pega:-
Obj-Save methodUse this method to request that the system save a clipboard page to the PegaRULES database or (if the page belongs to an external class) an external database. The Obj-Save method uses properties on the page to derive the internal key under which it will be saved.    
OBJ-SAVE Method
Above pictures shown the empty record of local database,Now we are going to save all            UI entered data to a local database.













Below is UI which accept some values.

Add one button and add action for that button show in below pictures

Create one activity add 3 steps in to activity 1)Page-New-Create new Temppage to clipboard and Refer that page to database page class(OG3WEG-FW-LeaveMan-Data-EmployeeDetails) class show in below pictures
2)Property Set-set all property value from pyWorkPage to TempPage so that all property value set to TempPage.

Added Temp page in pages and classes tab.

Use obj-Save method and add step page as TempPage so that entered data stored in to Data base which refer same data class which Temp page refer.


Now we are going to run our process,add section into flow action and flow action into flow


Add flow action 

Add section into flow action
















Run the flow
Entere all values in to section and click on save.
Now data has been stored in to data base















If you found your solution then don't forget to share it with your friends.