Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script to duplicate with new job number multiple times

Featured Replies

  • Newbies

Hi,

Im having a play with fm pro on a friends pc for my mowing business, its really good as i can customise it how i want. 

My scenario is. I have multiple customers that have regular bookings like every 2 weeks. 

When i add a new job i would like to before commit select a  "Frequency" and "FrequencyRepeat"

So when i add newjob , i would fill in the details and mowing date then select every 2 weeks and repeat 20 times, then hit create order, this will then save this order and copy the same order but with the new order number and also the right dates. 

Im hoping this is possible as at some point i want to have this sync to google calendar too but thats at a later date. 

 

I look forward to any help or response. 

Thank you

I would suggest you use 3 tables: Customers, Orders and JobDates. That way no information needs to be duplicated.

As for creating the records in the JobDates table, this should be easy enough using a looping script. However, in addition to frequency and the number of repeats, you also need to supply a starting date. Then your script can look something like:

Set Variable [ $orderID ; Orders::OrderID ]
Set Variable [ $startDate ; Orders::StartDate ]
Set Variable [ $frequency ; Orders::Frequency ]
Set Variable [ $repeats ; Orders::Repeats ]
Go to Layout [ JobDates ]
Loop
  Exit Loop If [ not $repeats ]
  New Record 
  Set Field [ JobDates::OrderID ; $orderID ]
  Set Field [ JobDates::Date ; $startDate ]
  Set Variable [ $startDate ; $startDate + 7 * $frequency ]
  Set Variable [ $repeats ; $repeats - 1 ]
End Loop
Go to Layout [ original layout ]

Note that this example assumes the frequency will always be given in weeks (it doesn't have to be). And it could be further improved by making sure the list is not duplicated if you accidentally push the button again.

 

 

Edited by comment

I would consider a different overall approach.  If you are the only one mowing, you may be better off reconciling at the end of the day, then generating a schedule for tomorrow.
IDK if pre-programming all your cuts for the summer (season) is a good idea, as a few days of heavy rain (even one day) throws the entire schedule out the window.
And if you don't get all of today's cuts done (weather, equipment break down, etc.), you'll have to make another adjustment.  I also wouldn't even bother with syncing to Google.  That's a lot of alerts, all day, everyday.

Every morning, or night before, with a simple search script you could generate a list based on frequency and 'next cut'.  You could even group them by location and look at them on a map.

And all of this can be on FM go on an iPhone/iPad

Edited by Steve Martino

  • Author
  • Newbies

Hi, thanks for your responses. Im hoping im setting it all up right. 

I lost my job with covid and decided to use my love for the garden to do super discount garden services for the aged, disability and people not able to do their own things. Im hoping to add an offsider to help me if i get really busy. 

Im not making money hardly doing this but its giving me a bit of a wage and i feel happy im helping out them in need :)

If anyone would like to help me with this initial setup i would appreciate it. I have setup the layouts, job page, new customer etc.

 

 

Post your file, see what happens :)

  • Author
  • Newbies

Hopefully some fairies might take my file and sort it out the right way :)

It will be good to see how it gets setup compared to how a noob like myself set up.

I appreciate any assistance. 

 

FCMaintenance.fmp12

  • Author
  • Newbies

btw user admin   and no pass :)

On 4/26/2021 at 6:24 PM, comment said:

I would suggest you use 3 tables: Customers, Orders and JobDates. That way no information needs to be duplicated.

I like this approach, however if you are working on a Mac I would do a double filing of JobDates in FileMaker and in Calendar, not sure how this would work if you are on Windows though.

Edited by ggt667

  • Author
  • Newbies

no fairies to help setup the file the proper way.... Oh well back to the drawing board :)

GGT667. I will only be using on PC

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.