Main Screen Readonly when launching Harness

Hi Team,

I have a requirement where in main screen, we have a button. On click of button, we are launching an harness in new window.

Now whenever my harness gets launched, my main screen should be readonly. and when user closes the harness window, then my main screen should be editable.

How can we achieve this?

Thanks,

Vignesh.

@Vigneshk2107 To achieve this, you can use a flag property. When the button is clicked to launch the harness, set the flag property to true and refresh the section. In the section, use the flag property in the ‘Disable’ condition of the fields. This will make the fields read-only when the harness is launched. When the harness window is closed, set the flag property to false and refresh the section again. This will make the fields editable again.

:warning: This is a GenAI-powered tool. All generated answers require validation against the provided reference

How to execute set of action events sequentially?

Conditional exit on UI Element Event based (clickable) actions

how can I create a work case through Activity

Making sections read only, disabling links and buttons when used on same screen?

@Vigneshk2107

To achieve the requirement of making the main screen readonly when a harness is launched in a new window and making it editable again when the user closes the harness window, you can follow these general steps in Pega:

  1. Launch Harness in New Window:

    • Configure your button to launch the harness in a new window. You can achieve this by using the “Open URL in Window” action or similar configurations depending on your Pega version.
  2. Set a Flag or Context Variable:

    • When the button is clicked and the harness is launched, set a flag or a context variable to indicate that the harness window is open. This can be done using activities or data transforms.
  3. Configure Dynamic Layouts or Controls:

    • On your main screen, use dynamic layouts or controls (like the section visibility conditions) that depend on the flag or context variable set in the previous step. Configure these to display or enable controls based on the status of the flag.
  4. Refresh the Main Screen:

    • Ensure that the main screen is refreshed after the flag or context variable is set. This might involve using actions like “Refresh-This-Section” or similar depending on your specific use case.
  5. Close Window Event:

    • In the harness that is launched in the new window, implement a mechanism to handle the window close event. This can be done using JavaScript if needed. When the window is closed, update the flag or context variable to indicate that the harness window is closed.
  6. Refresh Main Screen Again:

    • After updating the flag or context variable in the harness window, trigger a refresh of the main screen again to reflect the changes in the controls’ visibility or editability.