Method Community

 

Formula help

Last post 03-09-2011 12:26 PM by Matt. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-08-2011 3:12 PM

    • Matt
    • Top 10 Contributor
    • Joined on 11-03-2008
    • Posts 877

    Formula help

    I am trying to create a web form that has checkboxes to allow the customer to choose which service(s) they would like to receive an estimate on. To be able to add the checkboxes to the form, I added Yes/No fields to the opportunity table for example: Service1, Service2.

    In step 3 of the web form wizard I added Service1, Service2 so that they would show up on the web form and that works fine.

    I would like to take it 1 step further and have the Opportunity>Name field be updated based on which services are checked, so if they checked Service1, the opportunity name would be 'Estimate for Service1' I updated the formula for Opportunity Name to be: if(Contains('Service1_Step3','True')='true','Estimate for: service1','')

    When I click finish on Step 8, a window pops up saying: Service1_Step3 field should be required, since it was used in a formula for field Name_Step3. If I make Service1_Step3 required, the form will work (and the name field gets updated the way I want), so long as Service1 is checked. If Service1 is not checked, the web form will return an error when I click submit because Service1 is a required field and it is not checked.

    Is there a way to bypass making Service1_Step3 required? I saw that CompanyName_Step2 is used in formulas, but it is not a required field.


    Matt Raiser

    Founder,



    www.techinthefield.com

    matt@techinthefield.com

    219-221-9500



    ~ Method user / partner since 2008

    ~ Over 15 years field service experience

    ~ 2013 Method Partner of the Year

    ~ Degree in Computer Science





    Creator of:


        


  • 03-09-2011 12:04 PM In reply to

    Re: Formula help

    Hi Matt,

    There are few things there I would like to point out:

    Great with coming up with formula "if(Contains('Service1_Step3','True')='true','Estimate for: service1','')". If you want, you can even write something like "if(Service1_Step3=='True','Estimate for: service1','')" which is even simpler.

    Since checkbox field always has a value, if you set "Service1_Step3" to "Required", no harm will be done. Setting the field as required in web forms, will not make it required anywhere else.

    The reason why we have the "required" rule is because if some formula expects a value and no value is provided, the field will not get the expected formula result and will throw an error. If this field does not get a result, any fields that depend on it will also get broken and web form will not get submitted.

    So, is there any specific reason why you don't want the checkbox field to be required (knowing that it won't affect anything in your web forms)?

    Victor

  • 03-09-2011 12:26 PM In reply to

    • Matt
    • Top 10 Contributor
    • Joined on 11-03-2008
    • Posts 877

    Re: Formula help

    Hi Victor,

    I just re-read the error message that I got in the email. It appears the error was that the required Name field was left blank, which would make sense because without the checkbox checked, the formula wasn't entering a value for it. I was mistakenly thinking it was because the checkbox wasn't checked. 

    So, yes I can keep the checkbox field as required without it causing any problems. Thanks for the help and thanks for pointing out the correct way to write the formula.

     


    Matt Raiser

    Founder,



    www.techinthefield.com

    matt@techinthefield.com

    219-221-9500



    ~ Method user / partner since 2008

    ~ Over 15 years field service experience

    ~ 2013 Method Partner of the Year

    ~ Degree in Computer Science





    Creator of:


        


Page 1 of 1 (3 items)