Jump to content

Default mail address ( )


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

Recommended Posts

Name & Parameters: [color:red][big] Default mail address ( ) [/big]

Description:

Sample Input:

Results:

Recursive: no

Formula:

I'm working on the following calculation.



Case(

    Mail To = "Home";

    Mailing Full Name & "¶" & Home Street & ¶ & Home City & "," & " "& Home State & "  " & Home Zip Code;

    

Mail To = "Work";

    Mailing Full Name & Case(IsEmpty ( Title );"";   ", " & Title) & Case(IsEmpty (Company) ; "";¶ & Company & ¶ & Work Street & ¶ & Work City & "," & " " & Work State & "  " & Work Zip Code;

    

Mail To ="Spouse Work";

    Spouse Mailing Full Name  & Case(IsEmpty ( Spouse Title );"";   ", " & Spouse Title) & Case(IsEmpty ( Spouse Company ) ;"";¶  & Spouse Company) & ¶ & Spouse Work Street & ¶ & Spouse Work City & "," & " " & Spouse Work State & "  " & Spouse Work Zip Code)





Everything was working fine until I added the IsEmpty scenarios to Mail To = Work.  When I copied and pasted Mail To = Spouse Work into Mail To = Work and changed the appropriate fields, Spouse Work returned nothing and Work returned:



Name and a comma

Title with a 0



I can't imagine that copying and pasting would change the values in Spouse Work and can't figure out why I'm not getting the correct results in Work.



The results should be:



Name, Title

Company

Street

City, State  Zip Code



with Title and Company eliminated if nothing is entered in those fields and no blank line if Company is not entered.



Thanks,

ajnhlr



FM Pro Advanced 8.3

Mac 10.4.6

 

Required Functions:

Author(s): ajnhlr

Date: 05/24/06

Credits:

Disclaimer:

FM Forums does not endorse or warrantee these files are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deemed public domain unless otherwise indictated. Please backup every file that you intend to modify.

Link to comment
Share on other sites

Looks like you forgot a parenthesis when you were concatenating Company in the Work portion of your formula. Here's the entire formula:

Case(

Mail To = "Home";

Mailing Full Name & "¶" & Home Street & ¶ & Home City & "," & " "& Home State & " " & Home Zip Code;

Mail To = "Work";

Mailing Full Name &

Case(IsEmpty(Title); ""; ", " & Title) &

Case(IsEmpty (Company) ; "";¶ & Company) & ¶ & Work Street & ¶ & Work City & "," & " " & Work State & " " & Work Zip Code;

Mail To ="Spouse Work";

Spouse Mailing Full Name &

Case(IsEmpty ( Spouse Title );""; ", " & Spouse Title) &

Case(IsEmpty ( Spouse Company ) ;"";¶ & Spouse Company) & ¶ & Spouse Work Street & ¶ & Spouse Work City & "," & " " & Spouse Work State & " " & Spouse Work Zip Code)

Link to comment
Share on other sites

It would sure be easier overall if each person (and address) was a record instead of several fields. I would think you will run into many problems with this setup. Just a thought ...

This doesn't need to be a Custom Function and I'll move it to Define Fields a bit later after ajnlhr reads it. :wink2:

Link to comment
Share on other sites

You want to use the Not with the isEmpty.

I don't agree with your single field name, unless it is Concatenate

Case(not IsEmpty(Name); Name) & " " &

Case(not IsEmpty(Title); Title) &

Case(not IsEmpty(Company); "¶" & Company) &

Case(not IsEmpty(Street); "¶" & Street) &

Case(not IsEmpty(City); "¶" & City) &

Case(not IsEmpty(State); "¶" & State) &

Case(not IsEmpty(Zip); "¶" & Zip)

HTH

Lee

Link to comment
Share on other sites

This topic is 5664 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
 Share

×
×
  • Create New...

Important Information

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