Is it simple to add the custom buttons on the Signature control using Pega Infinity V8.x?
The answer for the question is YES. We can check the steps in this post and is simple to implement at our end. Before I jump on to the actual topic, I would like to give a brief idea on the Signature control functionality in Pega.
The Signature Capture control allows you to capture a user's signature when using either a desktop application or a mobile app accessed from the Pega 7 mobile application. Once a user has input a signature, it is added to the work item as an image attachment. Access the Signature Capture control from the Advanced dropdown in Designer Studio/Dev Studio. The control can be added within a cell in a dynamic or smart layout, to a section, or directly into a harness. Below is the sample look and feel once we sign it.
Now we need to take out the OOTB buttons from the control and use our buttons to take an action while signing. Sample screenshot with 2 buttons added.
Steps to follow:
1) Create 2 sections where one section has buttons and is embedded in other section with signature control. Have a property reference to the control. For eg: SignStatus is used in my case. This final section rule needs to be called from the portal wherever is needed in the application.
2) Call the below script functions from both of the buttons using Actions -> Click -> Run Script
Confirm button ==> "pega.ui.signature.acceptSignature"
Retake button ==> "pega.ui.signature.clearSignature"
Also, pass the 2 parameters while calling the above functions accordingly.
signName ==> "$PpyWorkPage$pSignStatus"
category ==> File
Sample screenshot for one button.
3) Create a DT rule to show/hide the signature status and the date values as per button click accordingly. Call this DT from the button's same Action -> Click -> Refresh. Pass the parameter to DT like Clear/Confirm to work on the button click accordingly. Here is the snapshot of the DT rule which I built.
That's it from the implementation of the custom buttons functionality in the signature control easily. There might be 1 or 2 drawbacks on using this approach but we can extend this approach as per our biz needs.
References:
1) Pega Community Site
2) Pega Developer Help





