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 subtract new value from old value

Featured Replies

Hi, i'm new to scripting...well new to FM...anyway, I have a database with a quantity field and a form on the web that allows the user to remove X amount. Now, I don't want the quantity to be edited, but instead the result of a subtraction. Would calling a script be the right direction?

quote:

Originally posted by Jtown:

Hi, i'm new to scripting...well new to FM...anyway, I have a database with a quantity field and a form on the web that allows the user to remove X amount. Now, I don't want the quantity to be edited, but instead the result of a subtraction. Would calling a script be the right direction?

Hmm, possibly. However I assume that you are trying to give a VALUE, then allow the user to type in a ADJUSTMENT, and then you will arrive at a TOTAL.

Simply make your TOTAL field a calculation, like the following: TOTAL = VALUE - ADJUSTMENT.

  • Author

hmm...I think the math part is easy, I just don't really understand what syntax to use in scriptmaker. In my webpage, I have the old recordid found and I have a quantity the user can enter to remover from the DB. I'm guessing the submit button will call a script, but how do I send it the both those values and write to the DB?

thanks for any help

quote:

Originally posted by Jtown:

hmm...I think the math part is easy, I just don't really understand what syntax to use in scriptmaker. In my webpage, I have the old recordid found and I have a quantity the user can enter to remover from the DB. I'm guessing the submit button will call a script, but how do I send it the both those values and write to the DB?

You should really be asking these questions in one of the web forums, if this question is how to get and manipulate data off of a web page.

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.