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

Pega.desktop.showHarness API does not work

SA-62932

Summary



The Pega.desktop.showHarness API function displays a harness in a new tab of the work area gadget using the parameters passed.

The below JavaScript function is added to the custom functions which are written to a custom JavaScript file created for a button.

function handle_terminateOB(terminationCode, away, wrapUpPCN)
{



pega.d.showHarness("CloseCase", "Data-Portal","pyDashboard7", "", "", "", "No", "", "Yes","Yes", "_blank", "", "");
}


This custom function is invoked through a Run Script action. Therefore, even when the tabName is the same (that is, CloseCase), the Pega application creates a new thread with the same name when the function is invoked each time instead of using the existing thread.


Error Messages



Not Applicable


Steps to Reproduce

  1. Create a custom script.
  2. Add a function to invoke the pega.desktop.showHarness API with the respective parameters.
  3. Configure a button with an onClick event - RunScript action to invoke the above custom method.
  4. Launch the portal.
  5. Navigate to the section in which the button is configured.
  6. Click the button to trigger the method.


Root Cause



A software use or operation error.
The API is intended to work from a document; however, the API is invoked from the parent document.



Resolution



Perform the following local-change:

Invoke the pega.desktop.showHarness API from the parent document.

var modules = document.querySelectorAll("#moduleGroupDiv div.iframe-wrapper");
var activeModule = null; 
for(var count=0;count<modules.length;count++){ 
if(modules[count].style.display=="block"){ 
activeModule = modules[count].querySelector(".dynamicContainer"); 


if(activeModule!=null){ 
var activeGadget = activeModule.getAttribute("pegagadget"); 
pega.ui.WorkAreaGadget.onGadgetClose(activeGadget); 
}

Published October 8, 2020

Was this useful?

0% 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