Jump to content

insert date based upon field state


This topic is 6150 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I would like to have a field automatically insert the current date based upon the condition of another field. I have a container field that has a script attached that inserts a persons signature when they click on "yes" from a question that pops up asking "Do you approve?" Yes, No, Cancel. What I would like to do is have a field called "Approved On" and have the date they approve it automatically inserted. Is there a simple way to do this? Any help would be greatly appreciated.

Link to comment
Share on other sites

Use Get(LastMessageChoice) to find out what was clicked. I usually put it into a variable:

Set Variable[ $choice ; Get(LastMessageChoice) ]

Set Field[ Approved On ; Case[ $choice = 1 ; Get(CurrentDate) ]

Link to comment
Share on other sites

You mean using a script, or field auto-enter options? Either way, you could use a simple Case statement such as Case( not IsEmpty(yourNumber) ; Get (CurrentDate) ).

In a script you might do it differently, using an If step:

If( not IsEmpty(yourNumber) )

Set Field( yourDate ; Get (CurrentDate) )

End If

Link to comment
Share on other sites

Tom,

The script suggestions work well but the auto-enter option doesn't. The field that has the number being entered into it is called "Class Funding" and the field I would like the date entered into is called "Funded On". The field "Funded On" is a timestamp field with auto-enter set to calculation and the parameter is "Case( not IsEmpty(Funding::Class Funding) ; Get ( CurrentHostTimeStamp ) )". Thanks for your help.

Link to comment
Share on other sites

Tom,

I figured it out. There are two tables involved. I copied the "Funded On" field to the funding detail lines table where the number field being referenced occurs instead of the primary table and it works fine. Thanks again for your help. It was greatly appreciated.

Link to comment
Share on other sites

This topic is 6150 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.