Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Import BPartner

vlr
2006-06-27
2013-05-02
  • vlr
    vlr
    2006-06-27

    Hi!
    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)
    ctx-?
    pi-?

    Can you post examples?

     
    • Hi,

      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?

      Regards,
      Trifon

       
      • 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
          http://globalqss.com

           
          • vlr
            vlr
            2006-08-05

            code
            Properties prop = Ini.getProperties();
            ImportBPartner iBP = new ImportBPartner();
            ProcessInfo pi = new ProcessInfo("Import BPartner", 194);
            iBP.startProcess(prop,pi,Trx.get(Trx.createTrxName(),true));

            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>(CPreparedStatement.java:49)
                at org.compiere.util.DB.executeUpdate(DB.java:746)
                at org.compiere.util.DB.executeUpdate(DB.java:705)
                at org.compiere.process.SvrProcess.lock(SvrProcess.java:364)
                at org.compiere.process.SvrProcess.startProcess(SvrProcess.java:75)
                at com.altoros.octoslave.compiere_salesforcecom.SalesforcecomToCompiereNode.executeTransform(SalesforcecomToCompiereNode.java:153)
                at com.altoros.octoslave.core.Runnable.execute(Runnable.java:37)
                at com.altoros.octoslave.ui.Actions$6.actionPerformed(Actions.java:175)
                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 java.awt.EventDispatchThread.run(Unknown Source)

            Why

            What fields should be filled in I_BPartner?