Showing posts with label delete in pega. Show all posts
Showing posts with label delete in pega. Show all posts

Wednesday, 24 October 2018

Obj-Delete and Obj-Delete-By-Handle in Pega

Obj-Delete and Obj-Delete-By-Handle in Pega


Today We will see how to use Obj Delete in Pega and how to use Obj-Delete-By-Handle in Pega.

This method is used to delete record from database. What is the difference between these two method??

  • If u don't know the Key (pzInsKey) of the record and U have to delete the record then U have to use Obj-Delete. 
  • If u know the Key(pzInsKey) then U can use Obj-Delete-By-Handle to delete the exact record.
Lets see how to use these two method in pega.

OBJ-Delete-By-Handle

My Local Table record is shown below.

Now lets create one activity in Work class and Write Code to Delete the record in this table.


Now I am going to delete a record from Table where Title is "Insurance Options" for that I use Obj-Browse

Now it will retrieve the record where title is Insurance Options. And U can see GetRowKey is enabled, that means it retrieve key also to clipboard. 


Lets Check key is available or not in clipboard.


pzInsKey is there so we can use this key to Delete this record. Lets Do it



Now in 3 rd Step I Loop through all the records available in CourseRecords.pxResults PageList and Copy the Key to a Local Variable Named Key.

In 3.1 th Step I used Obj-Delete-By-Handle 
Here I pass the Key Value to Delete . This indicates we are going to delete the record having the provided Key.

After this step I used Commit Method to Complete the process.

Lets Run and See whether it is deleting or Not.


Activity Run successfully Lets check in Local Table whether value is there or Not.


Now u can see the record is not there in table. We Successfully deleted a record. :)

OBJ-Delete

Lets See How to use Obj-Delete.

I will use this Method When I don't know the Key Value. Lets Delete the record having ID = SAL-002

I used Obj-Open to get the record in Clipboard.

Lets See whether Obj-Open retrieve values in Clipboard
.

Data is there , Now we can delete this record.


Now I added the Method Obj-Delete and Enabled Remove and Immediate Check Box.

And at last I added Commit to complete the transaction.

Lets Run the activity and test whether Record is deleted or Not.


Now U can see the record is not available after delete.



U can see SAL-002 record is not here. Thank u friends for reading and learning with me.If any doubt ask me in comment . Bye :)

Monday, 1 October 2018

How to recover deleted rule in pega

How to recover deleted rule in pega

Immediate recovery of rule in pega

In case if you mistakenly delete some rule, How to recover that rule? . Lets see how to do that.


Now I opened an activity and I am going to delete this activity. This is my activity.

On delete pega will ask for description.


After Delete the rule, On Upper right corner you can see the Restore Button. On clicking that button Rule will be recovered.


After Clicked that button, My rule is recovered.


How to recover deleted rules after few days in pega

Select Designer Studio -> Process & Rules -> Tools -> Find Rules


You can able to see this window on following that path.


In Critera to Find Rules, U can see many filter Options.

  1. Recently Updated.
  1. Recently Updated By Ruleset
  1. Find by Ruleset, Version and Rule Type.
  1. Find By Circumstance.

You can use any method to recover your Rules.

Now We use Recently Updated filter.


Before using this we have to delete a rule for recovery.
I deleted the same rule.

Now Click on the Number of rule it showing on right side.

Now window will display like this.
Recent updates to rules are displayed at the front line. In our case my recent update is delete an activity, that is at the first record. 

On clicking that record it show a message at buttom.

It says that record is no longer exists, so we have to recover from the history, so click on the Button to recover.

On clicking the Button the deleted Rule is opened, There Restore button is there,  We can use that button to restore.

I hope that U know how to recover the deleted rules in pega. Thank you for reading. We will see in next post. :)