Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Need help creating a simple script!


Squeezebox

Recommended Posts

Hey everybody,

 

I'm new to using Filemaker and I need a little help. I'm using Filemaker Pro 6 and I'm trying to get a specific date script to work. Pretty much what I'm aiming for is a script that is basically like this:

 

If the "Date Field" containing the date is less than the current date, then make all dates the current date.

 

I'm just a novice when it comes to using Filemaker and this may or may not be simple, but I really could use the help. Note that I need all records to change if that statement holds true, not just the one being browsed. I appreciate your time and thank you in advance!

 

-Squeezebox

Link to comment
Share on other sites

It's bad form to post the same question twice. People like to see what answers have already been provided before starting to type out an answer, and if someone later on does a search and finds one out of two copies of your post, they will not realize that a better answer is to be found on the other copy.

 

You say you are a novice: do you want to actually CHANGE (i.e., overwrite) the Date Field with current date for every record where the Date Field is a date earlier than today? Or do you want a new and different field that will DISPLAY today's date unless the original Date Field is for a later date, without destroying your data in the Date Field?

 

And if you DO want to change the Date Field data, do you need to do this over and over, like this week and also do the same thing again next week, or is this a one-time thing?

 

a) To change the data just once, do a Find for all records where Date Field

 

b) To do it via script, so you can do it by the click of a button as often as you need to, create this script and attach it to a button:

 

Enter Find Mode []

Insert Calculated Result ["

Set Error Capture [On]

Perform Find []

If [status(CurrentFoundCount) =0]

.. Show Message ["ain't none" / OK]

End If

Replace Field Contents [Date Field, calculated value Status(CurrentDate)]

 

c) To make a display field that does not overwrite your existing Date Field value but shows either today's date or the value of Date Field, whichever is greater, create a calculation field of result type "date" defined as Case (Date Field > Status(CurrentDate), Date Field, Status(CurrentDate) )

 

Set the storage on that field to "unstored" or it won't evaluate Status(CurrentDate) properly.

Link to comment
Share on other sites

I have a lot of records that contain a "Call Back Date" field that has current dates in it. I'm looking for a way to make it so I can just click on a button and it will automatically change the dates in every record in "Call Back Date" ONLY if it is less than the current date that the button was pushed.

 

Say I have 1/6/08, 1/7/08, and 1/8/08 ...

 

When I push the button on 1/10/08 ...

 

Those three dates above, in different records, automatically change to 1/10/08 ...

Link to comment
Share on other sites

Even when you are using "Insert Calculated Value"?

 

hmm... OK let's get down & mean with FileMaker 6... do this instead:

 

Insert Calculated Value [Date Field, "

 

 

 

sorry, they made scripted Find Mode for dates a lot less weird beginning with FileMaker 7, I forget sometimes how we had to jump thru hoops when scripting finds on dates back then!

 

Please DO leave your Date Field formatted as a date.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
Hey everybody,

 

I'm new to using Filemaker and I need a little help. I'm using Filemaker Pro 6 and I'm trying to get a specific date script to work. Pretty much what I'm aiming for is a script that is basically like this:

 

If the "Date Field" containing the date is less than the current date, then make all dates the current date.

 

I'm just a novice when it comes to using Filemaker and this may or may not be simple, but I really could use the help. Note that I need all records to change if that statement holds true, not just the one being browsed. I appreciate your time and thank you in advance!

 

-Squeezebox

Could you just replace contents? You could call up all records (Ctrl-J), sort by date (descending), and with your cursor in the field that has today's date, Replace Contents (Ctrl-=). This of course only works if the date field is not an auto-entry, but it will work if it's a text field that is manually entered.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use