[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

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  
0
SamirKumar
Asked:
SamirKumar
  • 8
  • 6
  • 5
  • +1
1 Solution
 
CRAKCommented:
A simple @Now or @Today?

E.g. in a button:

Field Status := "APPROVE";
Field Dt := @Text(@Today);
@Command([FileSave])
0
 
ArunkumarCommented:
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!
0
 
SamirKumarAuthor Commented:
I will test out the solutions this week cause I am done with finals!
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
zvonkoCommented:
Hello boys,

both answers are not complete.

Here my proposal.
Because you have not stated what the name of your radio button field is, I named it: RadioButton

So place please this formula into forms QuerySave event:
FIELD RadioButton:=RadioButton;
FIELD ApproveTime:=ApproveTime;
@If((ApproveTime="")&(RadioButton="approve");@SetField("ApproveTime";@Now);"")

This way is your approval done only one time (not on every save operation and not on every button click; why button?).

This formula does not erase the ApproveTime field after approver reverts his decision the change the approval to something else. Do you like to handle this exception too?


0
 
ArunkumarCommented:
You know what ? Samir is my buddy and he is going to offer me all the points with an "A" ..

Who wants to bet ?

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

0
 
SamirKumarAuthor Commented:
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
0
 
ArunkumarCommented:
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
0
 
zvonkoCommented:
I am sorry but my solution was for a RadioButton :(

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

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

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

0
 
ArunkumarCommented:
Well...i am confused now.

Which nuts are you talking about ?

;-)
0
 
zvonkoCommented:
I think for example about Excel ****s :)
0
 
SamirKumarAuthor Commented:
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?
0
 
zvonkoCommented:
My answer is: YES, it is possible.

0
 
SamirKumarAuthor Commented:
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



0
 
zvonkoCommented:
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?

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

This goes just like that !

;-)
0
 
SamirKumarAuthor Commented:
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
0
 
zvonkoCommented:
Thanks Samir :-)

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 8
  • 6
  • 5
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now