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

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

Recommended Posts

Posted

Hello,

In Scriptmaker, I'd like to insert a line in a script to remove a date from a date field. I would think I should use the "Set Field" script step, specify the date field I want to clear, and then enter "". However the calculation result must be a date so the field displays a "?" How can I rewrite this to simply get the date field to be empty?

Thanks.

Posted

Try Set Field [ DateField, DateToText( "" ) ]

Posted

For this, I would just use the Clear Script Step.

Clear [ AnyDate ] [ Select entire contents ]

Lee

Posted

Keep in mind that the field must be present on a layout in which the Clear[] script-step is activated (at least in vs. 7). Otherwise it won't clear the field. I don't believe this is documented in FM Help either ...

A straight Set Field [ dateField ; "" ] works in vs 7/8 now. It's a wonderful improvement over prior versions.

Posted (edited)

Good point. I don't think this has changed either.

Lee

:woohoo:

Long overdue, and thanks for point this out to me. I feel like a sponge with v8. Best version yet.

Edited by Guest
v8 remark
Posted

:

Hi Mr. Vodka!

Thank you. This worked. I wouldn't have thought of that since "Date to text" seems to contradict the calculation qualifier that result must be a date. I greatly appreciate your response.

Posted

Lee,

By "AnyDate" I assume you mean the date field I am trying to clear. If so, that didn't work. Thanks for the response, though.

Posted

AnyDate is my sample date field name. You would just substitute the name of your own Date Field for it.

The only reason that this [color:red]Would Not work, is if the field is not on the layout that you're on when using the script. (see LaRetta post )

Lee

:cool:

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