Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I am trying to write a script to add 7 days to the current date by clicking a button and enter the new date in a specified field. all help is much appreciated.

Running FM 5.5 PC

Best Regards, a311shark

Posted

Thanks for your feedback.

Here's what I have done and I am getting a ? in the field

Setup the new script in script maker with the appropriate field name.

Updated the button to perform the script.

IS there any way to see where the script is breaking?

thanks a311shark

Posted

I was wondering you were going to be able to use the Set Field in a date field. Most of the time you need to use the Insert Calculated Results for date

The Date field needs to be on the current layout,

Insert Calculated Result [select,

Posted

I think a set field should be okay as long as it's not a date range. But, it may have to be converted to with the TextToDate function:

SetField ("Date", "TextToDate(Status(CurrentDate)+7)")

Posted

Thanks for your help. Now I am getting Status(Call Date)+7 inserted in the space instead of the updated date?

I have a date field that I am getting the current date from

The field I am entering the data into is still formated as a date field?

We are getting closer but not quite there. Thanks

Posted

With the "Status(CurrentDate)" function or the "Today" function date you don't need another field and you can use the SetField script step.

I f you want to use the data from another field as "CurrentDate" (that's the way I understand your field

Posted

Hi:

"add 7 days to the current date by clicking a button and enter the new date in a specified field"

You don't need Insert Calculated result or DateToText if this is really a date field. What was told to you originally should work.

Set Field [DateField, "Status(CurrentDate) + 7)"]

Now, I am confused by your last post where you said that you were getting a date from a field "Call Date" or something like that. You should not need to get the current date from a date field, but if you want to set a date field to the value of one date field + 7, you would need something else. Please be more clear on what you are doing.

Ken

Posted

Here's what I have setup:

The field I want the sum entered into is named Call Back (date formated)

Set Field [Call Back, "Status(CurrentDate) + 7)"]

I get a ? instead of the new date?

Am I missing a configuration somewhere?

I don't have CurrentDate listed in the drop down for status? Is this the problem?

Posted

Here's where I am at

Set Field [DateField, "Status(CurrentDate) + 7)"]

This turns up a question mark.

I don't show Current Date under my status dropdown but I wrote it in:

Status(CurrentDate)

my DateField is Call Back which is formated as a date field which I am ussuming I want the resulting dat incerted in.

Set Field [Call Back, "Status(CurrentDate) + 7)"]

Thanks

Posted

I think the problem is the quotation marks. Take them out. The formula should be:

Status(CurrentDate)+7

not

"Status(CurrentDate)+7"

When the set field command is displayed in the script listing, it shows quotes around the formula, but you don't put them in when entering the formula.

Posted

Just to add more to the melee, I've found that Today seems to work fine in scripts. One such as: If ["Date = Today"] Show Message ["Yes"] Else Show Message ["No"] works when merely changing the system date on a user's machine. So it would seem that Today == Status(CurrentDate) when scripting.

This topic is 7649 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.