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

Calendar Pickers and Buttons Used To Create New Records in a Related Table


MA Francima
 Share

Recommended Posts

Hello Filemaker Community,

I have FM13 and I am trying to used calendar pickers to create records in a related table. The user should be able to click on one of the calendar dates (generated by repeating fields), this should then copy to pieces of data from the calendar and use these to create a new record. Then the user clicks on the date in the calendar a second time, the script should delete the record that was created in the related table.

Would anyone be able to assist with helping me to set up the scripting as I am new to FM?

I look forward to hearing from you soon.

Best Regards,

MA Francima

Driver Hire 1.fmp12

Link to comment
Share on other sites

In the file you posted, the Calendar table is empty -- it has no records.  How did you intend that it ever be populated with data, and what would the data consist of?  Where are the appointments or schedule records or whatever you wish to call them?  Can you describe what sort of data you would be scheduling or calendaring?  Would each such record consist of a single date?  Range of dates?  Hours 3:30 PM through 9:30 PM of a certain date?

 

Also, what was your thinking behind using repeating fields in the Calendar table?  It looks like each single record in Calendar is going to contain a whole slew of entire months.  Is this only being used as a "picker" to click on and indicate a date, which is then going to generate a record that gets created elsewhere?  (Where?)

 

 

 

Link to comment
Share on other sites

Hello AHunter3,

The Calendar is meant to be only be a picker. The user is meant to click on a date in the calendar and this is meant to automatically generate a simple record in the Availability table. When the user clicks on the Calendar date again (a second press), this should automatically delete the record in the Availability table.

The Availability table will ultimately have a large list of records indicated by just two fields: (1) the Calendar pIcker date pressed, (2) the user number or name of the user.

I hope that this helps with the question. It's difficult trying to describe the rationale.

Thank you fro replying to my query.

Happy New Year.

Link to comment
Share on other sites

Here you go.

 

a) Calendar records need to exist beforehand for each driver.  I made a script that creates one calendar rec for each existing driver.  You have two at the moment.

b) I removed lookups from your field definitions of some fields in Calendar, Drivers, and Availability.  They didn't make sense there.  Also removed a cascading delete from Calendar that would nuke a calendar record any time an availability record was deleted.  You certainly don't want to do that!

c) Driver ID was set to text in Calendar (and Driver) but number in Availability.  Changed it to text in Availability to be consistent

d) I made you a script but it is time consuming to attach the script to each individual square of your two-month calendar.  It's the same script but it sends a script parameter that is different for each square -- a script parameter exactly equal to the repetition.  So I only did the first row of the left hand calendar to give you the general idea.

 

 

 

DriverHire_modified.fmp12

Link to comment
Share on other sites

Oh my gosh! I have been stuck with this for the last few weeks! Thank you so much for this. I wasn't sure if you would have understood what I wanted to achieve. This will now allow me to make progress with my project. Thanks 100 times over.

Link to comment
Share on other sites

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.

 Share



×
×
  • Create New...

Important Information

Terms of Use