title: Event handler subscription on approveVariance
body: <p>I created an event handler subscription on <code>approveVariance</code> method in <code>VendInvoiceInfoTable</code>.</p>
  
  <p>Here is the code of the handler:</p>
  
  <pre><code>public static void postApprovingPendingInvoice(XppPrePostArgs _args)
  {
     VendInvoiceInfoTable vendInvoiceInfoTable;
  
     vendInvoiceInfoTable = _args.getThis();
  
     info(vendInvoiceInfoTable.PurchId + " from handler");
  }
  </code></pre>
  
  <p>All god and fine if i check and uncheck the checkbox myself. I am talking about the checkbox found on VendInvoiceMatchingDetails form with label :</p>
  
  <pre><code> Approve posting with matching discrepancies.
  </code></pre>
  
  <p>The problem appears when that <code>approveVariance</code> is called from a batch. The handler is not reached anymore. </p>
  
  <p>Is this a correct behavior ? Is there any valid approach to this? </p>
  
  <p>I think I can create a static method in a util class, and call it every time the <code>approveVariance</code> is called and send a specific parmeter. I just tried to follow the best practices. </p>