Question

Close Harness OnClick of Submit
Hi
In portal, launching one harness onclick of button as replace current. In the harness onclick of submit i want come back to portal.
Please suggest me.
Thanks for sharing your thoughts.
Best Regards
Chaitanya
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
-
Like (0)
-

Is this a perform harness on a work object or a static harness (like bulk actions)?

Not perform harness. Using events and ShowHarness we are displaying harness on buttons.

So on both buttons (Cancel/Submit) you would have Launch Harness as the last action defined, which would specify the Dashboard harness (pyDashboard7).
Alternately rather than launching your custom harness as 'Replace Current', you would have it as 'New Document' and then submit/cancel would fire the action 'Close'; the other advantage of this is that any filters or sorting done before the user launched the custom portal would be maintained.
I would lean towards the latter option, however that may impact the 'Recents' list.
If you go with the Launch Harness option, be sure to include the activities and data transforms needed to prepare the dashboard; you can use the navigation rule pyCaseManagerLinks as a guide (or pic below).

Data is not getting saved. When i am doing as mentioned above.
And i want to come back to portal from launched harness on click of submit.
Thanks for sharing your thoughts.
Chaitanya

So you have two event actions?
The first saves the data (May need a manual commit in your saving activity also,) and the second launches the portal or closes the current harness?

Hi Joel,
Exactly, we are saving the data through activity which is first event. Launching portal harness in second event.

Does the data save if you do an obj-save with the 'write now' option or if you do a manual commit in the activity?

Obj-Save with Write Now we are using. It's working fine but it's not going to previous screen is the original issue. (replace current)
Now, if we are using "NewDocument" it's closing fine but data is not saved.

Theres a couple of examplrs OOTB of similar functionality, such as updating operator leave schedules.
I'm home for the night, but I'll post a couple of examples in the morning.

I am not sure if i still understand the problem correctly. Why can't we use Cancel action on Submit button also ?
Your first event is the activity call which saves the data and second could be Cancel action.
Let me know what I am missing here. Do you want this Close to be conditional based on some validations/failures in Activity ?

So pyCaseManager Navigation rule has a similiar set up for 'Profile' (below,) it uses 'New Document'.
The harness it utilises is pxSocialUserProfile, within this is the pxSocialUserProfile section which has a Close button, with the event Action of 'Cancel'.
In your harness you may want to include the OOTB section: pxDisableClientDirtyDetection to ensure you don't get a save/discard warning when closing.
If there is a saving issue, I daresay you need to manually call the commit method as you are operating outside of contexts that would ordinarily handle that for you (such as flow processing).

there are two buttons one for cancel and one for submit and save the data. In both the scenario's we should come back to portal(previous screen).
For submit how can we come back by saving the data?

The actual issue is, on button click, on first event, i am calling my activity which actually saves my data and validates the fields in my form. But after that on second event , we did show harness which replaces current, this meets my requirement of coming back to my previous screen. But the problem is , if i have any page-set messages getting set due to validation, i need to skip my Show-Harness. Which has become a challenge. When i try to do Show-Harness in my activity . It is not working. Please suggest, if we have any OOTB event through which i can check condition before Show-Harness. OR the parameters that i need to pass in activity for Show-Harness, may be i miss something there.
Please suggest. Thanks in Advance

Having seperate save and close buttons isn't an option?

Even i tried that way, but in my form , i am creating an operator ID record. In actual OOTB form we Create pyUserIdentifier in one form and remaining details Edit form. But in my requirement i need to provide to user a single form to provide all their details which required to create an operator ID. As .pyUserIdentifier is unique, when i do save second time, my validation rule will fire and says, "User ID exists". And i cant make pyUserIdentifier "ReadOnly" on tab out, as that is not user friendly
Hi @rapaw, I am having the same problem as described in this thread but i also have a user form in the same section. The problem is that when you click the button, i am always getting this alert (setting the "Cancel" action) as you mentioned.
What is the approach to retrieve the close event when submitting?
Thanks in advance.

If it is a performharness how can it be handled