Changing value of a field

Hi!

I started learning Notes Designer last week, and I didn't see Lotus Script at all!

I only saw Forms, Views, Framesets and stuff like Hide-when, Roles and some basics formulas like @Command( [FileSave] ); or @Name([CN];@UserName);

The only thing I can't find out is simply to change the value of a field on FileSave, for example...

I tried this on an action button, just before the @Command( [FileSave] );  :

FIELD filedName := "a string";

But it doesn't work!
barbotteAsked:
Who is Participating?
 
qwaleteeConnect With a Mentor Commented:
Use computed when composed.  That saves with teh document.  It does not allow user eidts, it is saved with teh document, and the formula is only ocmputed when the value did not previously exist.  So, when you change the value, the formula won't compute again, and it will retain the value you have changed it to.
0
 
qwaleteeCommented:
Hi barbotte,

That should work... in a form, add this as an actio button:
FIELD someFieldThatIsAlreadyOnTheForm := "some value";
@Command([FileSave])

The field should already be a field added to the form design.  Make sure the name is spelled the same.

Cheers!
0
 
barbotteAuthor Commented:
Well, the value a the field is computed, maybe that could be the problem??

But I simply cannot put this field as Editable...  Still, I must be able to change the value, so...
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
RanjeetRainConnect With a Mentor Commented:
Computed fields work differently. The problem is that they DO NOT RETAIN data after having been closed, even if you save it. Because you simply can't save their values. As long as the document is open, you can CHANGE, you can READ the modified value. But all this lasts only as long as the document is open. As soon as you close down and reopen, its value gets reset to what you specified as its DEFAULT VALUE.

That's why a default value is a must for a computed field.
0
 
barbotteAuthor Commented:
I've put a defaut value...  But as it's a kind of "status" field (initial, open, assigned...) I don't want the people to change the value, and I want it computed only if some others fields are completed or if data is entered somewhere...

What would be the solution then, if I want a non-editable field which could still change value?
0
 
RanjeetRainCommented:
Make it "Computed when composed".
0
 
barbotteAuthor Commented:
Thank you!  it works!

I'll double the points to give you each 50 points, thank you for your time and your fast answers!
0
 
barbotteAuthor Commented:
there it is...
0
 
RanjeetRainCommented:
The real cool thing is that you know one thing more about Domino developement now :)
0
All Courses

From novice to tech pro — start learning today.