title: Dynamics ax x++ grid modified method
body: <p>I would like to ask a quastion. </p>
  
  <p>Lets say that I have a grid in form. In this grid I have two fields. The first field is the orderId and second field is the invoiceId.
  Each field has already an overloaded modified method.</p>
  
  <p>Lets say that my requirment is that if you fill the orderId in first field then the invoiceId should automatically filled in field 2.  and the same should happend in the opposit way. If I fill the invoiceId then automacally the related orderId should be automacally in field1.</p>
  
  <p>If for example comment out the related code of one method then works fine but only in one direction.</p>
  
  <p>But if I want it to work for both direction my ax client stop working.
  Looks like an infinity loop through modified methods and the debuger cannot help me.</p>
  
  <p>My quastion is...Exists any proper solution for this modified methods overlaping problem?</p>
  
  <pre><code>modified()// method for invoice Field
  {
     SalaryProvRevisions table = SalaryProvRevisions_ds.getFirst(1) ?    SalaryProvRevisions_ds.getFirst(1) :SalaryProvRevisions_ds.cursor();
     table.OrderId=SalarayProvInvoiceHandler::getOrderIds(table.InvoiceId);
  .
  .
  .
  .
  }
  
  modified()// method for ordeid field
  {
     SalaryProvRevisions table = SalaryProvRevisions_ds.getFirst(1) ? SalaryProvRevisions_ds.getFirst(1) : SalaryProvRevisions_ds.cursor();
     table.InvoiceId=SalarayProvInvoiceHandler::getInvoiceId(table.OrderId);
  .
  .
  .
  .
  }
  </code></pre>
  
  <p>of course this story has some others problems like one orderId can be related with a lot invoiceid.. but already solved them.</p>
  
  <p>Thanks a lot,</p>
  
  <p>Nikos</p>