Jump to content

This topic is 7941 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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.

Posted

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

This topic is 7941 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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