Open a window (Swing UI) programmatically

From iDempiere en

Opens the invoice window in Swing UI.

/**
 * Opens invoice window
 * @param c_invoice_id
*/
public boolean openInvoice(int c_invoice_id) {
  // AD_Window_ID of customer invoice window
  final int AD_Window_ID = 167;
  String whereString = " C_Invoice_ID = " + c_invoice_id;
  final AWindow poFrame = new AWindow();
  final MQuery query = new MQuery("C_Invoice");
  query.addRestriction(whereString);
  final boolean ok = poFrame.initWindow(AD_Window_ID, query);
  if (!ok)
    return false;
  poFrame.pack();
  AEnv.showCenterScreen(poFrame);
  AEnv.addToWindowManager(poFrame);
}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.