Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Custom code for DoSave function does not get picked



Custom code for DoSave function does not get picked. An html fragment is configured with custom JavaScript function and referred in the section which is embedded in a harrness. Onclick event is configured for the button in the harness and Action as Save.

The requirement is to modify the DoSafe function and pick the one that has extra code to call a custom activity. This works fine in PRPC 6.x and fails after upgrade to Pega 7.

Error Messages

Not Applicable.

Steps to Reproduce

1. Create a harness, configure it to open on a click of URL control.
2. Have a button in the Harness, the  button has a single onclick event “Save” defined in it.
2. Create an HTML Fragment with the code provided and refer this in a section.

Root Cause

The issue is with incorrect overriding of the function.


Following is the Local-change:

To make the custom JS override the Out-Of-the-box (OOTB) doSave function, you must call the function using below mentioned prototype:

pega.ui.Doc.prototype.doSave = function (bSaveAndContinue, event) {

Custom Code


Published May 21, 2015 - Updated October 8, 2020

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us