Answers.Body: <p>Make sure those "missing" fields aren't used in the title format (under the advanced tab) or in your notifications -  both in the control panel. Ran into something similar just now.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-25T21:46:48.203Z
Answers.LastActivityDate: 2017-09-25T21:46:48.203Z
Answers.UserDisplayName: erwinheiser
Body: <p>I'm working on a site that was partially built by another dev and am having some trouble with Sprout Forms. </p>
  
  <p>It's partially working but when I add a new field (sailSeries) to the template (it exists in the sprout forms control panel) I get this error:</p>
  
  <pre><code>Craft\SproutForms_EntryModel and its behaviors do not have a method or closure named "sailSeries".
  </code></pre>
  
  <p>Expanding on what the original dev has I added the sails series inside this for loop at the bottom.</p>
  
  <pre><code>{% for tab in form.getFieldLayout().getTabs() %}
      {% set fields = tab.getFields() %}
  
      {% for field in fields %}
  
        {% set required = field.required %}
        {% set tabId = field.tabId %}
  
        {% set field = field.getField() %}
  
        {% if field.handle == 'contactType' %}
         {% set dropdownField = field %}
        {% endif %}
  
        various more fields
  
  
        {% if field.handle == 'sailSeries' %}
          {% set  sailSeries = field %}
        {% endif %}
  
      {% endfor %}
  {% endfor %}
  </code></pre>
  
  <p>The the code later in the template to have the field display:</p>
  
  <pre><code>&lt;div class="frm-row"&gt;
  &lt;div class="section colm colm6"&gt;
  
      {% set submittedDropdownValue = attribute(submittedEntry, sailSeries.handle) %}
  
      &lt;label class="field select"&gt;
        {{ sailSeries.name }}
          &lt;select id="sailSeries" name="sailSeries"&gt;
          {% for option in sailSeries.settings.options %}
              {% set defaultValue = option.default ? option.value : null %}
              {% set selectedDropdownValue = submittedDropdownValue != '' ? submittedDropdownValue : defaultValue %}
  
              &lt;option value="{{ option.value }}" {% if selectedDropdownValue == option.value %}selected="selected"{% endif %}&gt;{{ option.label }}&lt;/option&gt;
          {% endfor %}
          &lt;/select&gt;
          &lt;i class="arrow"&gt;&lt;/i&gt;                    
      &lt;/label&gt;  
  &lt;/div&gt;&lt;!-- end section --&gt; 
  &lt;/div&gt;&lt;!-- /.frm-row --&gt;
  </code></pre>
  
  <p>As soon as I add this in I get errors. Not sure why or how to troubleshoot. Please advise.</p>
  
  <p>Revised code and now I'm getting this error:</p>
  
  <blockquote>
    <p>Variable "sailSeries" does not exist.</p>
  </blockquote>
  
  <p>no clue why this is happening.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-12T14:58:10.320Z
Comments.Text: Probably obvious, but is the field listed in the form in the control panel?
Comments.UserDisplayName: erwinheiser
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-13T13:43:14.977Z
Comments.Text: @erwinheiser yes it is.
Comments.UserDisplayName: CreateSean
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-14T11:15:43.010Z
Comments.Text: @CreateSean Are you getting the error when you load the form page the first time or after you submit the form? The second block of code appears to be displaying information after the form is submitted in which case you may have to check if the `sailSeries` variable is defined on the initial page load before form submission.
Comments.UserDisplayName: Ben Parizek
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-14T12:59:58.380Z
Comments.Text: @BenParizek This error is on page load. The form is in an include - should these variables be defined on the page where the include is called?
Comments.UserDisplayName: CreateSean
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-14T13:20:57.683Z
Comments.Text: @CreateSean I'd have to see the full template code, but the Submitted Entry `SproutForms_EntryModel` is going to be null until after you submit a form. Once a form is submitted, a Form Entry is created and the form values are returned to the page as a `SproutForms_EntryModel`. On the first page load (before a form is submitted), you'll need to check and confirm that the `SproutForms_EntryModel` exists before you try to access any attributes that it contains.
Comments.UserDisplayName: Ben Parizek
Tags: <error-message><plugin-sproutforms><entrymodel>
Title: Craft\SproutForms_EntryModel and its behaviors do not have a method or closure named
ThreadText: # Craft\SproutForms_EntryModel and its behaviors do not have a method or closure named
  
  (Asked by: username_0 on 2017-07-11)
  
  I'm working on a site that was partially built by another dev and am having some trouble with Sprout Forms.
  
  It's partially working but when I add a new field (sailSeries) to the template (it exists in the sprout forms control panel) I get this error:
  
  ```
  Craft\SproutForms_EntryModel and its behaviors do not have a method or closure named "sailSeries".
  
  ```
  
  Expanding on what the original dev has I added the sails series inside this for loop at the bottom.
  
  ```
  {% for tab in form.getFieldLayout().getTabs() %}
      {% set fields = tab.getFields() %}
  
      {% for field in fields %}
  
        {% set required = field.required %}
        {% set tabId = field.tabId %}
  
        {% set field = field.getField() %}
  
        {% if field.handle == 'contactType' %}
         {% set dropdownField = field %}
        {% endif %}
  
        various more fields
  
        {% if field.handle == 'sailSeries' %}
          {% set  sailSeries = field %}
        {% endif %}
  
      {% endfor %}
  {% endfor %}
  
  ```
  
  The the code later in the template to have the field display:
  
  ```
  <div class="frm-row">
  <div class="section colm colm6">
  
      {% set submittedDropdownValue = attribute(submittedEntry, sailSeries.handle) %}
  
      <label class="field select">
        {{ sailSeries.name }}
          <select id="sailSeries" name="sailSeries">
          {% for option in sailSeries.settings.options %}
              {% set defaultValue = option.default ? option.value : null %}
              {% set selectedDropdownValue = submittedDropdownValue != '' ? submittedDropdownValue : defaultValue %}
  
              <option value="{{ option.value }}" {% if selectedDropdownValue == option.value %}selected="selected"{% endif %}>{{ option.label }}</option>
          {% endfor %}
          </select>
          <i class="arrow"></i>                    
      </label>  
  </div><!-- end section --> 
  </div><!-- /.frm-row -->
  
  ```
  
  As soon as I add this in I get errors. Not sure why or how to troubleshoot. Please advise.
  
  Revised code and now I'm getting this error:
  
  > Variable "sailSeries" does not exist.
  
  no clue why this is happening.
  
  **Tags:** error-message, plugin-sproutforms, entrymodel
  
  > **Comments:**
  > **username_1**: Probably obvious, but is the field listed in the form in the control panel?  
  > **username_0**: @username_1 yes it is.  
  > **username_2**: @username_0 Are you getting the error when you load the form page the first time or after you submit the form? The second block of code appears to be displaying information after the form is submitted in which case you may have to check if the `sailSeries` variable is defined on the initial page load before form submission.  
  > **username_0**: @username_2 This error is on page load. The form is in an include - should these variables be defined on the page where the include is called?  
  > **username_2**: @username_0 I'd have to see the full template code, but the Submitted Entry `SproutForms_EntryModel` is going to be null until after you submit a form. Once a form is submitted, a Form Entry is created and the form values are returned to the page as a `SproutForms_EntryModel`. On the first page load (before a form is submitted), you'll need to check and confirm that the `SproutForms_EntryModel` exists before you try to access any attributes that it contains.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-09-25. Score: 1
  
  Make sure those "missing" fields aren't used in the title format (under the advanced tab) or in your notifications - both in the control panel. Ran into something similar just now.
  
  
  ---
  
  