In form I have field (text editable) named A1.
How I can change this field to non-editable when field value is not empty?
I mean - somebody creates new form, fills field A1, saves form and field A1 is not editable after save?
In form I have field (text editable) named A1.
How I can change this field to non-editable when field value is not empty?
I mean - somebody creates new form, fills field A1, saves form and field A1 is not editable after save?
Subject: How to change field to “non editable”
Put a hide-when condition that hides the field after it has been ppulated. Add a computed text (or computed for display field) that displays the value of the now-hidden field. This computed text should have the negated hide-when condition that your field has. To the user, it will appear as if the field is there but not editable.
Bear in mind that hide-when formulas will be recomputed with each document refresh so it may be that you don’t really want to hide the field if the field contains a value. For example:
User enters name: Joe Blggs
User exits the field and then causes a refresh.
Now the field contains incorrectly spelled name but user cannot edit the text any longer.
Subject: RE: How to change field to “non editable”
Works perfectly, thanks a lot!
Subject: RE: How to change field to “non editable”
Heh, Your advice works with text field…
But now I’m see - I have RichText firlds (users put in these fields text and attachments)…
Subject: RE: How to change field to “non editable”
You didn’t provide the release number you’re on. If you’re on Notes 7 or your field is displayed in OS style and you’re at least on 6.5, there’s an even more elegant way to do it:
Editable fields have an event called “Input Enabled”. Simply add a formula like
@If(
@IsNewDoc;
@True;
@ThisValue != "";
@False;
@True
)
and your done. With this sample code, the field will become non editable as soon as the document is saved for the first time while it is not empty. No double lines, no hide-whens to take care of.
Now on to RichtText items. No way to do it like this. RT items are a whole container structure on their own within the document container. They can have their own hide-whens per paragraph and all sort of stuff. You can have a RT item computed to another RT item, but that’s not robust. Personally, I had the best results with access controlled sections. Set some flag field if the RT field should be no longer editable and use that in the access control formula (you do not have to show the delimiters of the section, they can be hidden separately from the content).
But, finding out if a RT item is empty or not is not that trivial (does it contain text, or just attachments or embedded pictures or embedde objects or any combination …). It starts (but does not end with) the fact, that RT items become a part of the document only after it has been saved. There is a classic article on updating RT without saving the document by Andre Guirard, which you would find in the forum FAQ. If the link to the FAQ would still be there on the right navigation. Obviously, someone at Lotus decided in his infinite wisdom, that it is no longer needed. So, try to find that via the regular search (good luck).
So, the short story is: It can be done (sort of), but it’s not as easy as with regular fields. Just hope I didn’t tell too much bullshit about RichText here, because Ben will jump in and teach me (and you) better.