title: How to create an search using the Filter Condition as an Formula Date Field with NVAL2 Function in SuiteScript 2.0 version
body: <p>I want to create an custom search using Suite Script 2.0 version with the Filter Condition as an <strong>Formula Date Field</strong> with <strong>NVAL2 Function</strong></p>
  
  <p>I'm achieving this search on the UI as Saved Searches but i want create it on the Code itself. </p>
  
  <p>Search Filter Created on the UI(Saved Search):</p>
  
  <p><a href="https://i.stack.imgur.com/srpr3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/srpr3.png" alt="Filter Condition using Formula Date field with NVAL2 Function"></a>  </p>
  
  <p><strong>My Code:</strong></p>
  
  <pre><code>var mySearch = search.create({
      type: 'customrecord_configuration',
      columns: ['custrecord_supervisor'],
      filters: [
          [
              [
                  ['custrecord_from_date', 'greaterthanorequalto', fromDate],   'AND', ['Formula Date', 'lesserthanoreqaulto', NVL2({
                      custrecord_end_date
                  }, {
                      custrecord_end_date
                  }, TO_DATE('01/01/2200', 'MM/DD/YYYY'))]
              ]
          ]
      ]
  });
  </code></pre>
  
  <p>Thanks in Advance.</p>