Link to home
Start Free TrialLog in
Avatar of SamirKumar
SamirKumar

asked on

Date stamp on a field

Hello Notes Expert,

It has been a long time since I have posted a question regarding notes but this one is out of my reach.  I have a field on a form where technology officers can approve a request by a system users.  I have a radio button field where approvers can click either new, pending, approve and deny.  

I need a formula/script for a field that will capture the date when an officer only selects APPROVE.  

Also the approver field is always valued.  When the form is intially created the approver field reads new and when they click on submit the field value moves to pending.  At that point the officer can choose to either approve or deny the request.  

As a reminder, I need a script or formula for a field that can capture the date for when the approver clicks approve.  I hope that explains my problem.

Thanks
Samir  
Avatar of CRAK
CRAK
Flag of Netherlands image

A simple @Now or @Today?

E.g. in a button:

Field Status := "APPROVE";
Field Dt := @Text(@Today);
@Command([FileSave])
Avatar of Arunkumar
Arunkumar

Hey Samir !

Make it a computed field of DateTime datatype and have its formula as @Now

Thats it !

Whenever the document is edited and saved this date and time will change.

You can infact label it as "Last Edited Date/Time"
Optionally you can have another field that says, "Last Edited By" and have a Text computed field with a formula as @Name([CN]; @UserName)

By keeping these two fields, you will know who the last person edited this document and at what date and time.

Good Luck!
Arun.
PS: Welcome back buddy!
Avatar of SamirKumar

ASKER

I will test out the solutions this week cause I am done with finals!
ASKER CERTIFIED SOLUTION
Avatar of zvonko
zvonko

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You know what ? Samir is my buddy and he is going to offer me all the points with an "A" ..

Who wants to bet ?

;-)
Should I ask him to increase the points for me <|:-)

I have a field below which reflects the managers status but I use action buttons to make it easier on them.  In this application, managers do not revise there selection and they can either choose approve or deny.  So basically, I need a field that will just capture when the status field equal approve.  The date stamp will just reflect the date when the field was marked approve.  

My goal is to subtract that date from the date the document submitted by the users but for now the date stamp will be fine.

Thanks
Samir
okay you have some code behind the approve button right ? And after approve you hide this button. Correct me if i am wrong.

Use that button to set another field called approved date.
And use @SetField("ApprovedDate" ; @Now). Thats it.

Let this field be of datetime type and computed with the value of ApprovedDate (the field name itself)

Hope this is fine for you right ?

If u still have troubles send the db to arunkumar@rocketmail.com and i will do something for you and send it back okay ?

All i want you to do is give the points to me and not to my brother Zvonko !

|-)
Arun
I am sorry but my solution was for a RadioButton :(

ActionButtons are much simpler: one action and one result; no decision :-)
See !

Zvo knew that Samir and Arun are buddies he gave up !

;-)
Not really Arun, I know that for really hard nuts Samir trusts me; simple peanuts done by buddies <|:-)

Well...i am confused now.

Which nuts are you talking about ?

;-)
I think for example about Excel ****s :)
I will test the solutions after the long weekend.  
Another question (yes/no) is it possible to create an agent that will take values of response documents and put them back on the parent document.  I want to consolidate an application from having response docs to single docs.  I just need an agent to convert the data, don't want to loose it.....

yes will be fine and if yes I will post the question for large points....

Large enough nut for you guys?
My answer is: YES, it is possible.

If it is possibe, how hard is it to implement on a 3000 documents?  

I am assuming I would have to create fields on the main form to import the values from the response documents.

Also, I liked Zvos' answer to this problem, the querysave formula is most efficent cause it takes care of the button and field.  

As stated earlier, I will test this out on Tuesday but that does seem to be the best solution......

Samir



Without near looking I would say 3000 documents are never a problem for an agent :-)

To give you a good example for such an agent I would need some details.
1.) Are all response documents of same type (same Form, same Fields)?
2.) Are there response to response documents to handle?
3.) Do field and item names produce a collusion? Are there same items in parent and response documents beside the internal fields?
4.) Have field names at transfer time to be mapped to new names or be prefixed?

Do you prefer LotusScript or @Functions agents?

Get a collection of all the 3000 documents and use NotesDocumentCollection.StampAll

This goes just like that !

;-)
Simple solution for a simple problem.

This works great and now I can subtract dates to track requests.  

I guess I was thinking beyond the scope of the problem.

Good Job,
Zvo
Thanks Samir :-)