title: How to write custom function in crystal report to be used for record selection
body: <p>I am confused in writing custom function in crystal report to fetch record using record selection.</p>
  
  <p>When we create formula in record selection it will add where clause in the generated SQL-Query on the basis of parameters used. Now i want to write the custom formula, which will extract the record pro-grammatically :</p>
  
  <p>Even i have written a function :</p>
  
  <pre><code>Function (stringVar st)(
     stringVar selection; 
     if (st &lt;&gt; 'ALL') then (
          selection = st;
      )
      else(
          //In this case the user select only single value, it will fetch the result to that                //particular column value in the table.. otherwise it leaves that particular row..
          selection = "multiple selection";
  
      )
  )
  </code></pre>
  
  <p>Now the code to use the custom function in record selection using select expert would be :</p>
  
  <pre><code> if(myfunction({?parameter1}) &lt;&gt; "ALL") then
      (
          // what code should i write to select that particular record...
          if(myfunction({?parameter2})) &lt;&gt; "ALL" ) then
          (
              //do selection from the previously selection of rows which have this parameter
               if(myfunction({?parameter3}) &lt;&gt; "ALL") then
               (
                   //do selection from the previously selection of rows which have this 
                   //parameter
               )
               else (//do something else) 
          )
          else (//do something else)
      )
      else (//do something else)
  </code></pre>
  
  <p>Thanks, in advance.</p>