Solved

How to get Branch and Company IDs via SOAP API

  • 23 November 2021
  • 9 replies
  • 115 views

Userlevel 2
Badge

Is there any glossary of complete customer object fields? I’m using SOAP API and some of the fields aren’t coming with the getSchema object and I have to find them by searching through Acumatica question/answers but I don’t know where they are listed properly??

 

So far I found:

LastModifiedDateTime

CreatedDateTime

Now looking for Branch and Company IDs but don’t know the exact field names.. any help?

icon

Best answer by Naveen Boga 30 November 2021, 03:49

View original

9 replies

Userlevel 6
Badge +3

Hi @adilaleem 

Its not possible to get the BranchID and CompanyID through the API call. But we can get the current company ID and BranchID using the below code.

  int? companyId = PXInstanceHelper.CurrentCompany;
 string branchID = AccessInfo.branchID;

 

Userlevel 2
Badge

Hi @adilaleem 

Its not possible to get the BranchID and CompanyID through the API call. But we can get the current company ID and BranchID using the below code.

  int? companyId = PXInstanceHelper.CurrentCompany;
 string branchID = AccessInfo.branchID;

 

Thanks Jinin. How to get PXInstanceHelper? what reference or library should I use?

Userlevel 6
Badge +3

Hi @adilaleem 

please use  PX.Data.Update as reference. 

Userlevel 2
Badge

Hi @adilaleem 

please use  PX.Data.Update as reference. 

Is there something I need to install?

Userlevel 6
Badge +3

Yes @adilaleem  , we need to add Px.Data dll 
 

We can add the dll reference from the Acumatica instance Bin Folder.
 

 

Userlevel 2
Badge

Thanks Jinin.. but I don’t want to install anything. There must be a way to get Company and Branch info through webservices/APIs? if anyone else knows please help? @Chris Hackett any idea?

Userlevel 6
Badge

Hi @adilaleem unfortunately I am more community manager than product expert at this time. I rely on the experts like @jinin to help others out with the product questions. :grin:

Userlevel 2
Badge

Also when I tried get it from DLL, project is throwing an error and not recognizing PX?? I have tried it with different Frameworks like 4, 4.5, 4.5.1, 4.5.2 and 4.5.7 but none of them working? I noticed that I also have a different path for the PX dlls at compare to yours: C:\Program Files\Acumatica ERP\AcumaticaERP\Bin\

Userlevel 7
Badge +12

Hi @adilaleem  Could you please let me know, what version of Acumatica you are using?

If you are using higher version of Acumatica and lower version of DotNet framework you will get these kind of issues.

If you are using Acumatica version 21 R1, 21 R2 or 22 R1, then you should use the DotNet framework 4.8 version.

Let me know if this helps you.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2020  Acumatica, Inc. All rights reserved