Import BPartner

  • vlr

    vlr - 2006-06-27

    I need help! :)
    How to import business partners (BPartners)?
    As I know, need to fill I_BPartner table and run process() method of the Server class.
    What means parameters Properties ctx and ProcessInfo pi. How to fill it? Where I can get it?

    process(Properties ctx, ProcessInfo pi)

    Can you post examples?

    • Trifon (An ADempiere founder)


      why don't you standard import functionality. Winodw "Import BPartner"

      As far as i understand you are trying to modify source code, do you need it?


      • vlr

        vlr - 2006-06-28

        I develop Java application which must copy business partners from one database to Compiere database.

      • vlr

        vlr - 2006-06-28

        How call Winodw "Import BPartner" from java application?

        • Carlos Ruiz

          Carlos Ruiz - 2006-06-29

          It seems like you need to fill properly the I_BPartner table and start the org.compiere.process.ImportBPartner process.

          Now, I have never called a process directly.

          Maybe you can achieve that with the following instructions:


          import org.compiere.process.*;

          ProcessInfoParameter parameter = new ProcessInfoParameter(
                  "AD_Client_ID", (Object) new Integer(get_AD_Client_ID()), null,
                  "Client Code", null);
          ProcessInfo pi = new ProcessInfo("Your title", 194 /* look at the comment*/ );
          ProcessCall.startProcess(get_Ctx(), pi, get_Trx());
          // where 194 is the AD_Process_ID for "Import_BPartner" process
          // this code is for educational purpose :-)
          // it's a better idea to get the 194 ID from a parameter, preference or
          // query, not harcoded

          // get_Ctx, get_Trx and get_AD_Client_ID must be replaced with your
          // variables or methods for context, transaction and AD_Client_ID


          Please give us feedback if that works for you.  I'm very interested on that.

          Carlos Ruiz - globalqss

          • vlr

            vlr - 2006-08-05

            Properties prop = Ini.getProperties();
            ImportBPartner iBP = new ImportBPartner();
            ProcessInfo pi = new ProcessInfo("Import BPartner", 194);

            Exeption after iBP.startProcess(prop,pi,Trx.get(Trx.createTrxName(),true));
            Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
                at org.compiere.util.CPreparedStatement.<init>(
                at org.compiere.util.DB.executeUpdate(
                at org.compiere.util.DB.executeUpdate(
                at org.compiere.process.SvrProcess.lock(
                at org.compiere.process.SvrProcess.startProcess(
                at com.altoros.octoslave.compiere_salesforcecom.SalesforcecomToCompiereNode.executeTransform(
                at com.altoros.octoslave.core.Runnable.execute(
                at com.altoros.octoslave.ui.Actions$6.actionPerformed(
                at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
                at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
                at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
                at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
                at javax.swing.AbstractButton.doClick(Unknown Source)
                at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
                at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
                at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
                at java.awt.Component.processMouseEvent(Unknown Source)
                at javax.swing.JComponent.processMouseEvent(Unknown Source)
                at java.awt.Component.processEvent(Unknown Source)
                at java.awt.Container.processEvent(Unknown Source)
                at java.awt.Component.dispatchEventImpl(Unknown Source)
                at java.awt.Container.dispatchEventImpl(Unknown Source)
                at java.awt.Component.dispatchEvent(Unknown Source)
                at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
                at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
                at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
                at java.awt.Container.dispatchEventImpl(Unknown Source)
                at java.awt.Window.dispatchEventImpl(Unknown Source)
                at java.awt.Component.dispatchEvent(Unknown Source)
                at java.awt.EventQueue.dispatchEvent(Unknown Source)
                at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
                at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
                at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
                at Source)


            What fields should be filled in I_BPartner?


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks