I have a use case where I have applied the following to several fields that allow Staff to have "Edit" functionality while masking or disabling the view for Guests so their experience is "Read-only".
The problem is that I want the guest to see the changes, but not have the ability to change them.
I have a single form set in place with New, Edit, and Display. Are you suggesting that I can create an additional set – a second New, Edit, and Display set? I am also still using the desktop Plumsail Forms Designer; I am not ready to upgrade to the browser-based version.
Scenario
Staff (Licensed 365/EntraID Member) creates an item
Staff populates key fields
Staff assigns to EntraID Guest
Guest is notified of pending work
Guest populates and/or edits key fields
Guest clicks custom button which notifies Staff of their pending work
In the form are many fields, as you’d expect; only a few of which need to be Read-only for the Guest and simultaneously Edit-abled for Staff. I used the JS editor to apply fd.field(field).disabled=true; for guests and fd.field(field).disabled=false; for staff to the fields in question based on logged in user. This works beautifully to block guests from editing, but when staff makes any changes to the form, the fields do not update/refresh when a Guest opens the item later.
I have a workaround that I have put in place and is working, but I think I am missing a key piece and defer to your wisdom. An older workflow I implemented looked like a "leap frog" or, better yet, a dumpster fire scenario. It still makes me cringe looking at it. Messy and way too many lines I think.
The read-only issue catches me all the time and I think I have forgotten lessons learned but searching the community posts, I can't quite find where this has been done elegantly. Thank you as always for your thoughts.
Dear @shedev,
The changes not being visible are strange, perhaps the cache is the issue? Try adding the following code line to JavaScript editor:
localStorage.clear();
However, designing form sets is the default recommended option for such cases, they would be almost identical to the ones you have and would be easy to maintain. Alternatively, you can hide these fields entirely with:
fd.field('Title').hidden = true;
And then replace them with text controls, where field names are placed in square brackets, like so: Title: [Title]
We HIGHLY recommend updating to the latest version of the editor though, it's still a desktop application, and the v2 editor is no longer supported, containing multiple bugs that have been fixed in the latest version of the editor. It can always be downloaded here - Plumsail Account