title: How to get table field name from a FormBuildStringControl control
body: <p>I would like to ask how I can take the physical table field Name from  a FormBuildStringControl.</p>
  
  <p>Genarally I could say that I have to loop all string controls of a form.
  and find the correcponding Table field Names. </p>
  
  <p>At first I achive to navigate through all controls with the help of the following link. <a href="http://microsoft-dynamics-ax-erp.blogspot.de/2012/07/iterate-through-all-controls-of-form.html" rel="nofollow noreferrer">Loop form fields</a></p>
  
  <p>The first part works like a charm and I can navigate into form controls without any promlems, but  my Problem is when I would like to find the Table fieldName.</p>
  
  <pre><code>     switch(control.handle())
         {  
            case classnum(FormBuildStringControl):  
  
            FormBuildStringControl   formBuildStrControl =Control FormBuildStringControl;
            str name = formBuildStrControl.name();
            info( formBuildStrControl.name()); // THE CORRECT VALUE  CustTable_CustAccount
  
            info(fieldId2Name(formBuildStrControl.dataSource(),formStrControl.Datafield()));// THE FALSE VALUE ORDERID
  
           info(tableId2Name(formBuildStrControl.dataSource()))// false  value SalesLine
  
           break;
      }
  </code></pre>
  
  <p>I have not the excpected results from the methods fieldId2Name(), and tableId2Name(). the reason is the datadield and the datasource() methods does not return the corrects IDs from the SalesTable and from CustAccount</p>
  
  <p>Have someone any suggestion how I can get out the correct table field Name from a FormBuildStringControl ?</p>
  
  <p>Thanks
  Nikos.   </p>