title: switch case in microsoft dynamics nav
body: <p>HI I try to use a switch case in microsoft dynamics nav.</p>
  
  <p>I have this:</p>
  
  <pre><code>CASE Betalingswijze OF
          'kontant':
             TemplateHeader.Code :='KNT-KLANT';
  
          'rekening':
             TemplateHeader.Code :='REK-KLANT';
          'automatische incasso':            
              TemplateHeader.Code  :='BIN-INC-KL';
          ELSE
          TemplateHeader.Code  :='KONTANT';
    END;  
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>    RecRef.GETTABLE("&lt;Customer&gt;");
      //connect the payment method to the TemplateHeader and update the record:
      //rekening
      TemplateHeader.SETFILTER(TableID, FORMAT(18));
       IF Betalingswijze := 'kontant' THEN
      TemplateHeader.SETFILTER(TemplateHeader.Code,'REK-KLANT' );
      UpdateRecordTemplate.UpdateRecord(TemplateHeader, RecRef);
  
      //kontant
      TemplateHeader.SETFILTER(TableID, FORMAT(18));
      TemplateHeader.SETFILTER(TemplateHeader.Code,'KNT-KLANT' );
      UpdateRecordTemplate.UpdateRecord(TemplateHeader, RecRef);
  
  //automatische incasso
  TemplateHeader.SETFILTER(TableID, FORMAT(18));
  TemplateHeader.SETRANGE(TemplateHeader.Code,'BIN-INC-KL' );
  UpdateRecordTemplate.UpdateRecord(TemplateHeader, RecRef);
  </code></pre>
  
  <p>But now all the tree options are selected an not one.</p>
  
  <p>So how to manage that only one selection will be selected?</p>
  
  <p>Thank you</p>