Jump 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.

Featured Replies

  • Newbies

So, I've been tasked with getting our FileMaker 10 working more the way we want it for 2015. I've already managed to get the layout and calculation issues fixed and working. Now I'm working on some scripting which is an area I've alwasy struggled with. Here is what I need to do. When we write up orders, some customers are tax exempt. I have created a field where I can input an "X" to label as Exempt, but I need to be able to remove the tax from the calculation for just that particular order. Here is a screen shot of the area on the layout I am talking about. Here is the script as I have it set up:

 

If [Workorder::Tax Exempt = "X"]

    Insert Text [select; Workorder::Tax; "Exempt']

End If

 

My question is two part, can the script be set to run automatically upon putting an "X" in the Tax Exempt Box? And can it be set so that if I add more items to the order and it recalculates, that is doesn't put the tax back in?

 

This is a common mistake in our business of someone marking an order as Exempt, but adding more items to it and forgetting to take the tax back off.

post-112652-0-19966500-1419972737_thumb.

Why does this need to be scripted? Why not simply calculate the tax (or not), based on the Exempt field's contents (which ideally would be either 1 or empty)?

  • Author
  • Newbies

Ok, Maybe I overestimated my abilities when I said "Intermediate" skill level, because I can't figure out how to put that into the calculation. Right now the "Tax" field is set to calculate "Subtotal * .07" What do I need to add in there so that it will not calculate the tax if the "Tax Exempt" field is marked with an "X"?

 Right now the "Tax" field is set to calculate "Subtotal * .07" What do I need to add in there so that it will not calculate the tax if the "Tax Exempt" field is marked with an "X"?

 

Try =

Case ( IsEmpty ( Tax Exempt ) ; Subtotal * .07 )

Or, if you accept my suggestion to make Tax Exempt a Number field, using a value of 1 for True:

Case ( not Tax Exempt ; Subtotal * .07 )

Even better would be to use =

Case ( not Tax Exempt ; Subtotal * TaxRate )

and auto-enter the current tax rate into the TaxRate field. Without this, any change in tax rate will modify your existing records, which could be disastrous.

  • Author
  • Newbies

Thank you. That worked perfectly. I don't know why I didn't think about using the case function in the calculation. Too close to the problem, I guess.

Although your question has definitely been answered correctly, if you do need in the future to run scripts triggered on field changes/saves, look at the script triggers -- FM is quite powerful in this respect.

Create an account or sign in to comment

Important Information

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

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.