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.

Loops

Featured Replies

I have problems with loops, and try and avoid them, but they soon catch up with you. So I need a little help.

I have a database, and the three fields this script is dealing with are

1. Quote price

2. Deposit paid

3. Deposit paid by – pop-up menu with cash, visa etc.

I have created a script like this (Each an IF statement)

1.Check to see if “deposit paid” and “deposit paid by” are empty. If yes massage to check if user forgot to add deposit amount, or OK to continue.

2.Check if “deposit paid” valid and “deposit paid by” not empty. If “deposit paid by” empty user directed to select “deposit paid by” type, as you can not have a “deposit paid” amount and no “deposit paid by” selected.

3.As above but “deposit paid” not empty.

4.Check if “deposit paid” is greater than “Quote price” - choice to then change “quote price” amount or “deposit paid” amount.

OK here it is, I want to loop, do I loop the whole script, or each individual statement?

Trevor

It's not clear why you need a loop. Also, how is this script triggered?

Is it because you are trying to process a set of records?

Or is it because you're trying to catch each of these errors, and want to ensure that it triggers for each time the user fails to enter the required values?

If the former, yes, a loop would probably be necessary. If the latter, you have a number of options open to you. I have seen the use of a combined calculation to simultaneously test multiple fields, or you might set the individual fields to be required. The combined calc might look like:

IsEmpty(Deposit Paid) + IsEmpty(Deposit Paid By) + (Deposit Paid > Quote Price)

Then you test the value of this; anything greater than 0 indicates an error.

David

  • Author

Thanks, I see what you mean, I will try what you say .... I think I was off track and you have kindly shown me the right direction I should be going in.

Thanks again

Trevor

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.