Big news! The community will be moving to a new platform April 21. Read more.
Big news! The community will be moving to a new platform April 21. Read more.
Admiral
Admiral
2267 views

When submitting into an app, is there a way of setting a checkbox in a related app?

Jump to solution
When I submit into a solution app with an any-to-any subtask transition from a related workflow app, I set a checkbox. Form actions disable that subtask transition when the checkbox is checked, so that the subtask transition can't be used again.

However, if the subtask transition is canceled, the checkbox has already been checked.

In the workflow app, I can anticipate canceling the parent subtask transition by invoking a transition in the parent from an action in the child submit transition. The invoked transition acts on a field. If that field were set in the parent, then it couldn't be undone when the subtask transition is canceled. This way, the field is only set if the subtask transition is completed.

In the solution submit, in Properties > Actions, there is no option to invoke a transition.

Is there some way of updating a field in the workflow app when I submit from there into the solution app?
0 Likes
1 Solution

Accepted Solutions
Commodore
Commodore
I do this quite a bit.
From the primary Item, I have a subtask transition that is a circular loop on the current transition.
when the transition is complete, i send a trigger from the subtask back to the primary item.
On the primary item I set an action on the state that if the trigger received then perform the transition that sets the checkbox.

View solution in original post

11 Replies
Admiral
Admiral
I thought of a simple way: Instead of setting the field value as an override in the subtask transition, create a transition action that invokes a separate transition to set the field value. That way, if the subtask transition is canceled, the field won't be set.
0 Likes
Admiral
Admiral
Doesn't work--the transition named in the transition action is invoked even when the subtask transition is canceled.
0 Likes
Admiral
Admiral
I'm more confident a post-transition appscript would work, but not certain. After all, when you cancel a subtask transition, a message appears (illogically?) that the transition already took place.
0 Likes
Commodore
Commodore
I do this quite a bit.
From the primary Item, I have a subtask transition that is a circular loop on the current transition.
when the transition is complete, i send a trigger from the subtask back to the primary item.
On the primary item I set an action on the state that if the trigger received then perform the transition that sets the checkbox.

View solution in original post

Admiral
Admiral
In my confusion, I didn't realize that it's not the subtask transition that I'm canceling--it's the submit transition. It's been a long time since I've tried to set up a trigger. Will it work from a solution to a regular app?
0 Likes
Admiral
Admiral
Charity,

The guide is clear as mud on setting this up.

Thanks,
Phil
0 Likes
Admiral
Admiral
I've set up the trigger. Not confident it will work.
0 Likes
Admiral
Admiral
Trigger doesn't fire, so I must be missing at least one step.
0 Likes
Admiral
Admiral
Thank you, Charity! The trigger works. Still wondering why I had to put it on 3 transitions coming out of a Decision, because the Submit transition has no option for a trigger action.
0 Likes
Fleet Admiral
Fleet Admiral
For me, the ideal way to do this would be to define a Rule in Composer that said "'Related Subtasks' field is Empty", then use that Rule on the Transition's "Restrict by Rule" section. That's assuming you have a Multi-Relational field populated by SBM in the "Post Options" section for "Set new item in original item's field". That field will only get set if the Subtask transition AND the SUBMIT on the Subtask item both complete.

Unfortunately, we can't use multi-relational fields in Rules. Strange, because we can use multi-user fields.

You can hide the transition button with a form action on the state form that says "Disable the "Subtask" button if the 'Related Subtasks' field contains anything. That would require using a custom button for that transition. If you don't want to use a custom button, you can still do it with a form action by using a line of JS to hide SBM's transition button. You'll need the UUID of the "subtask" transition (from the database), then make a Form Load action:

When
this form is loaded
If
Related Child Items field is not empty
Then
execute javascript

jQuerySBM("#TransitionId_" + LookupTransitionId("8ca6973c-0f5e-443f-b35a-404a1560177e")).parent().hide() ;


The GUID is the UUID of the Subtask transition. Unfortunately you can't use the Transition name or internal name in the "LookupTransitionId" function.
0 Likes
Admiral
Admiral
Thanks. Interesting, but I succeeded with the trigger, and it is a classic approach.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.