Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

nils and errors

Help
jj4188
2006-12-18
2013-06-03
  • jj4188
    jj4188
    2006-12-18

    When I create a formula, I get an error when one of my variables has a null in the database.  For me it happens  when I am adding strings together, but I don't know if I get errors when adding numbers.

    Here's my formula.

    customer_type = {Customer.CustomerType}

    displayed_name = 
              if customer_type != 'Business'
                       {Customer.FirstName} + " " + {Customer.LastBusinssName}
              else
                      {Customer.LastBusinssName}
              end

    Business customers can have a null in the first name field, but I don't get an error on business customers with this formula.  Other customer types are not supposed to have nulls in the first name, but sometimes bad data gets in.  A result of another program, not mine!

    Any way, I am not a programmer.  Can anybody tell me how to augment this code or rewrite it to ignore nils?
    Should I not be creating this as a formula, but as a User Column.  Thanks JJ