Support Article
Custom code for DoSave function does not get picked
SA-9892
Summary
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.
Resolution
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
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.