Jump to content

Adding an appointment in FM 10


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

Recommended Posts

Just picked up FM 10:)

In a table, Contacts, in setting a date from the pop calendar for appointment with a date, say, for 3 weeks down the road, I want FM to alert me, when that appointment three weeks "later" arrives via a bouncing dock icon (as FileMaker will always be open) that I have an appointment.

So far I have created an event script and want that to go off when the appointment date = the current date, but am not sure how to go further,if this is the right approach ....

Does FM 10 has built in scripts that enable this feature?

Link to comment
Share on other sites

Have you traced down the hex parameters in send event that actually makes the dock icon bounce? - well done!

But wouldn't it be more obvious to let iCal send you a mail which then is tied to a rule to make Mail App bounce in the dock?

Perhaps this would be a way to achive some of it?

http://www.qutic.com/product/FM-iCal-Connector

--sd

Link to comment
Share on other sites

No, I have not traced anything down -- but I in following up on the information that this was possible now in FM10, I conclude that it must be incorrect?

The most important thing is to have some kind of alert based on the date chosen in a contact's field triggered by the arrival of that date (in real time) -- I realize that you could create a script one could run daily, but I want to know if and how to that could be automated, asap, if possible ....???

Please!

Link to comment
Share on other sites

I update of bare necessities, by the request of the ones who hire me and I fall under thier VLA licensing scheme. So whatever actually is tooted via the marketing trombones, doesn't affect me much!

Perhaps if you can point me to the source, you're referring to ... would it begin to make sense to me. My initial thought was that you somewhat have mixed up the functionality of fm 10 and Bento2 which is a tinySQL client enambled to dig deep into iCal and Addressbooks data?

The new event trigger include an OnObjectModify feature, but it only as far as I know monitor scripted inserts in a layout, not when the field suddenly turns something new via unstored calc'fields evaluation - but perhaps someone here could enlighten me if this is a wrong take on it??

--sd

Edited by Guest
Link to comment
Share on other sites

Thanks for the the directive:)

So in using the On timer Script step:

"Interval seconds is the value in seconds that the timer waits before running the script"

So perhaps, once a week, a script would run a "find" for those dates that + current date -- 7 days = 60,480 seconds -- then show a custom dialog with the find. Or 8640 seconds for daily, etc.

"This step repeats until the window in which it is running closes or its options change"

This seems to imply that the "contact" window always must be "in front" at the file/application level -- is there a way for this to be set for all layouts?

Link to comment
Share on other sites

mr_vodka!

Good idea -- thanks but I have a followup on the 2-part script I have written:

First part: Install On Timer script ["Current date find"; interval; 6840] that specifies the following script based on the calc: current date_calc = "x" defined where if current date = appointment date, then "x"

Second part:

Go to layout ["Contacts" (contacts)]

Show All Records

Go to Field (contacts::current date)

Insert Current Date [select; Contacts::current date]

Perform Find [Restore]

If [contacts::current date_calc = "x"]

Go to layout ["Contacts" (contacts)]

Show Custom Dialog ["appointments today"; "You have at least one appointment today"}

If (Get (LastMessageChoice) = 1]

Halt script

End If

End If

If [contacts::current date_calc = "y"]

Show Custom Dialog ["appointments today"; "You have no appointments today"}

Go to layout ["Contacts" (contacts)]

Halt script

End If

If the Perform Find [Restore] finds a match all is well; however, if not the Find creates the clunky dialog box, "No Records match this set of find requests" with choices: "Cancel"; "Continue" and "Modify Find".

How can I write this so as to avoid having the user respond daily to the "Find" when there are no matches.

How can I set when the timer "zero point" is; ie., how can I set a daily timer interval of 8640 seconds (24 hours) to run at, say, 9 AM each day?

Link to comment
Share on other sites

How can I write this so as to avoid having the user respond daily to the "Find" when there are no matches.

http://fmhelp.filemaker.com/fmphelp_10/en/html/scripts_ref1.36.14.html

--sd

Link to comment
Share on other sites

Thought of this since -- is this the best way?

A pre - first part:

Install On Timer script ["Current time find"; interval; 180] that specifies the following script based on the calc:

Insert "Current Time" in to field "current time"

Case (current time > "8:30:00 AM" and current time < "9:30:00 AM"; "X"; "Y")

If "x" continue with script, etc.

Link to comment
Share on other sites

Error capture has to be turned on prior to the action that you are trying to capture an error for.

So...

Error Capture [On]

Perform Find

Link to comment
Share on other sites

First part:

Install On Timer script ["Current time 9AM find"; interval; 55] that specifies the following script based on the calc: current time_calc = "x" defined 8:59:00 < current time > 9:00:00 and appointment time, then "x"

Second part -- "Current time 9AM find":

Go to layout ["Contacts" (contacts)]

Show All Records

Go to Field (contacts::current time)

Insert Current Time [select; Contacts::current time]

If [contacts::current time_calc = "x"]

Perform script ["Check for appointments"]

If [contacts::current time_calc ≠ "x"]

Halt script

End If

End If

"Check for Appointments"

Go to layout ["Contacts" (contacts)]

Show All Records

Go to Field (contacts::current date)

Insert Current Date [select; Contacts::current date]

Set Error capture [on]

Perform Find [Restore]

If [contacts::current date_calc = "x"]

Go to layout ["Contacts" (contacts)]

Show Custom Dialog ["appointments today"; "You have at least one appointment today"}

Halt script

End If

If [contacts::current date_calc = "y"]

Show Custom Dialog ["appointments today"; "You have no appointments today"}

Go to layout ["Contacts" (contacts)]

show all records

Halt script

End If

Link to comment
Share on other sites

Geoffrey, the part of the first script shown here is irrelevant:

If [contacts::current time_calc ≠ "x"]

Halt script

End If





Here in the following snippet is "Show All Records" irrelevant, and have been ever since the arrival of the "Constrain Found Set" with fm6...




Go to layout ["Contacts" (contacts)]

Show All Records

Go to Field (contacts::current date)

Insert Current Date [select; Contacts::current date]




Next issue is, shouldn't this have been broken out in an other table, otherwise would a contact only have one possible appointment. You have most probably thought of this and solved it with a repeating field, and deliberately ruled yourself out of any sort of statsistics?



But if you had broken this out in relations, could you have searched in the appointments table and via a List( using the bidirectionality of the relation to put something meaningful in your dialog by substituting the ¶ with a , to show who you were having apointments with ... BTW what happened with you bouncing dock icon?



Then do you need to explain why your script is fired each 55th second, when it's just required once each day, and the solution works 24 hours a day, wouldn't it be more appropriate to establish how long time there is to 9AM from the initiation of the solution and the make the interval to Seconds(Time(24;0;0))



 ... as I read the documentation, can each layout only have one installed, which must mean if you call the command again in the same layout will it be overwritten, with a new interval.



However would I with you structure script it this way:





If [ Get ( ScriptParameter ) ] 

     Install OnTimer Script [ “MessageScript”; Interval: Seconds(Time ( 9 ; 0 ; 0 ) - Get ( CurrentTime )) ] 

Else 

     Install OnTimer Script [ “MessageScript”; Parameter: 1; Interval: Seconds(Time ( 24 ; 0 ; 0 )) ] 

     Enter Find Mode [  ] 

     Set Field [ Untitled::TheDate; Get ( CurrentDate ) ] 

     Set Error Capture [ On ] 

     Perform Find [  ] 

     Show Custom Dialog [ Message: "You have "  & Case ( Get  (FoundCount );Get ( FoundCount ) ;"no")  & " appointments 

today!"; Buttons: “OK” ] 

End If 

...and I would assign the script as initiation script as well if you should have been turning off the workstation at some point, but chances are that if you arrive late say 9:30 AM and starts the engine you will miss one days appointments. But this can be obtained by putting the query outside the "if" statement.

One problem with your repeating field for appointments is if there should be two appointments with the same contact during the same day.... : then is my use of Get(FoundCount) restricted to facilitate yours " at least one appointment " only!

--sd

Link to comment
Share on other sites

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