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.

Confused with "If" and "Case" Statements

Featured Replies

Hi all,

This shouldn't be a tough one for you but I've been going nutz over it. I have my visual quickstart book and I've been browsing the forum but I'm still kinda confused.

Basically, I have billing address info and shipping address info. I have a field that says "shipping same as billing". What I'd like to have happen is that if someone clicks the option for "yes", the billing field data automatically echoes in the shipping address fields. Otherwise, the user enters it manually.

I can't figure out if and case statements. I'm confused what data goes into what section of the calculation. From what I've read, it seams like the case function is more powerful. I'm open to either, as long as I can understand it and get it to work. Thanks.

Greg

You would probably be better off using Set Field in a script instead of a calculation.

Set Field[shipAddress1, billAddress1]

Set Field[shipAddress2, billAddress2]

...

Set Field[shipZipCode, billZipCode]

HTH, Mike

I think mkd256 is correct here. That is, if the user clicks a yes button then there is no decision to be made, just attach a script to it, that does the above mentioned Set Fields. Maybe you want to check that they are empty first in which case you could use an 'if' statement:

if(shipAddress1="", <do set field>,<else display warning>).

So, to answer your question, an 'if' consists of a condition for param1, a true result for param2, and a false result for param3. It's kind of a sub-set of the 'case' statement. The 'case' statement takes one or more conditional and true results and 0 or 1 default results.

Hi,

agreed a script would be easy in this situation.

If you like to have a calc field, you'll need a script anyway to change the option.

May be hold a "num field" = n_choose adress (could be 0 or 1)

and a Choose Function grin.gif (Hehe !!)

Choose((num field), billing adress, shipping adress )

and a script

Togglescript = Set Field ("num field", abs("num field")-1)

will toggle from 0 to 1.

But as I believe the adress comes from a previous lookup from the contact file, the script would be easier...

  • Author

Thanks everyone for your contributions. I ended up taking mkd256's advice. It works like a charm.

Greg

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.