How to replace viewed forms in a tab using a process

Contains tips for configurators working with Aware IM
Post Reply
andreic
Posts: 29
Joined: Mon Nov 15, 2021 11:09 pm

How to replace viewed forms in a tab using a process

Post by andreic »

Hi all,
I'm trying to implement a replacement of the currently viewed "edit" form with its "readonly" version once the user sets a status attribute to something like "finished".

Scenario:
The status is "unfinished". The user opens the "edit" version of the form in a new tab.
The user works with that, and decides to set the status to "finished" (some text attrib.)
Setting that triggers a process that replaces the "edit"version of the form with its "readonly" version.

Problem:
If that process uses a VIEW action to show the "readonly" version, it does show the right form, but it is shown on top of the old one, meaning the user can still click the back button of the browser and return to the "edit" version, or the user can close the "readonly" form and then again the "edit" version is visible.

I need to really replace the "edit" version with the "readonly" one. To actually close the "edit" form completely in the same tab and show the "readonly" version in that tab instead.

Is there a way to do this?

Thanks, andrei
Jaymer
Posts: 2536
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: How to replace viewed forms in a tab using a process

Post by Jaymer »

there's 5 variables involved here (at least), all dependent on EXACTLY what you mean and you want.

example:
you say he changes a field and the form becomes read only. for sake of discussion, let's say its a field "Paid in Full" (PIF).
makes sense - once this record is PIF you can't edit ALL or SOME fields (this is one scenario)

IF its SOME fields, you could put them in a Separator group - with a condition.
OR ALL fields in one big group on the screen.
(but this may fail if you're already using some Sep groups and visibility, but maybe you're not - we don't know - no pictures supplied yet)
Don't like the "border" of the Sep group - thats the CSS legend and can easily be hidden.

Is there a SAVE of the form involved? Or as you say, just typing something in a field?
Do you want the user to have to SAVE the form?
How about click a non-save button.
Some fields can auto-save the form when its changed and you lose focus.

The presentation rules you put on a field evaluate when the Form is drawn the first time - so you have options there if you can close this form and re-display it.
Of course, if you really want ALL fields to be read-only, AND you can get a process to redraw the form (VIEW Invoice USING aaa) THEN you can add "NOEDIT" to the end of the VIEW and its read-only.

Oh, then there's READ PROTECT which can fire from a Rule, which is marked DYNAMIC, can fire when this field/button/??? is changed.

So, lots of ways to go, and there's no simple answer to your Q without seeing anything.

I'm sure I could think of a few more options, but its based on these unknowns presented here as to whats available.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
andreic
Posts: 29
Joined: Mon Nov 15, 2021 11:09 pm

Re: How to replace viewed forms in a tab using a process

Post by andreic »

I thought it would be possible to simply replace the form the user sees once a "status" field is set. I don't mind if this is done with a button. Either way, simply close the current "edit" form and show the "readonly" form.

I can then design the "readonly" version as needed. This solution seems the most efficient. And it works, only that showing the "readonly" form using VIEW doesn't really replace the "edit" form, and that's what I would like to get working.
PointsWell
Posts: 1476
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: How to replace viewed forms in a tab using a process

Post by PointsWell »

There are pros and con to both routes.

PROTECT and READ PROTECT endure as long as the conditions remain in place, so if the controlling condition is set to true it will always trigger the PROTECT rule meaning the class of end user it is protected from can never alter this by accident I.e. that time when you accidentally open with the wrong form.

With the form specific route if the form was open in its own specific tab you could trigger a rule to close the tab then start a process to open the form in another new tab. This will create a bit of screen flash as the tab closes and reopens. This may not be the effect you are looking for but it will remove the ability to back navigate the page. You will of course have to set this read only form to be the default edit form or remember every time you open the BO to use that form.
andreic
Posts: 29
Joined: Mon Nov 15, 2021 11:09 pm

Re: How to replace viewed forms in a tab using a process

Post by andreic »

PointsWell wrote: Thu May 19, 2022 10:11 pm With the form specific route if the form was open in its own specific tab you could trigger a rule to close the tab then start a process to open the form in another new tab. This will create a bit of screen flash as the tab closes and reopens.
Yes, that is EXACTLY what I'm trying to do.

How do I get this right though? For example, VIEW doesn't let me set the tab title. So if I close the tab with the "edit" form, the new tab will get the title "New Tab". Can this be changed somehow?
PointsWell
Posts: 1476
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: How to replace viewed forms in a tab using a process

Post by PointsWell »

Try

VIEW … IN TAB

search the manual. Can’t remember correct syntax
andreic
Posts: 29
Joined: Mon Nov 15, 2021 11:09 pm

Re: How to replace viewed forms in a tab using a process

Post by andreic »

This seems to be available only for the combination ENTER NEW .. AND VIEW IN TAB
Not applicable for my case. Either way, this action also doesn't allow to set the tab title or id.
Post Reply