Stamping current date and user details

Hello.

Is it possible for someone to show me how to do something in a formula?

I have a form with some fields and an embedded view. One of the fields is the project completion date field. When a project is finished , i would like the current date to be stamped in the project completion date field when clicking on the OK button. As well as stamping the current date i would like it to stamp the user who has confirmed the project is finished and this person will be the one clicking the OK button.

Thanks

H

Subject: Stamping current date and user details

Hello Holly,

Use below code…

2 fields - Date & Username ( Make this computed, if you don’t want to edit)

write this code in OK button

@Do(@SetField(“Date”;@Created);(@SetField(“Username”; @Name([CN];@UserName) )))

Thanks

Vj

Subject: RE: Stamping current date and user details

Two recommendations on the previous code- to avoid confusion, call the date field something like CompletionDate - so it is not confused as a creation date or some other date- and I would not store the common name, rather the hierachical or abbreviated name- so it would read@Do(@setfield(“CompletionDate”;@now);@setfield(“CompletionSigner”;@username)

Subject: RE: Stamping current date and user details

Hello,

Thank you both for your suggestions, however when i preview the new changes i get the following error messages :o/

No formula specified for computed field: CompletionDate

and

No formula specified for computed field: CompletionSigner.

I have made both these fields computed and i have tried both the formula’s in my ok button but the error message still appears.

Please help??

Thank you for your time :o)

H

Subject: RE: Stamping current date and user details

You are trying to save the form with computed fields that have no formula in them. Computed fields require some value.

You can compute them to themselves in this case the formula should the name of the field. You could also make them empty if its new with the following:

@if(@IsNewDoc; “”; CompletionDate),

and etc…

Continue to use the previous suggestions for the button formulas as they are.

Subject: RE: Stamping current date and user details

Thanks!

All works now

Subject: RE: Stamping current date and user details

Hey and if you can get into a good habit of using @thisValue you can copy and paste your code:

@if(@IsNewDoc; “”; @ThisValue),