We were working on a project that would pass our e-commerce orders into Acumatica through Web Service API.
As part of the order process, we need to search through Customers to get the one we need, and then we want to have ability to make change to this customer data based on primary key, i.e. BAccountID; however, when I used Web Service API "AR303000Export" to get customer info, I didn't see "BAccountID" in the data that I was getting from Acumatica, therefore I couldn't update that Business Account record based on primary keys (BAccountID and CompanyID, we already have CompanyID).
Is there anyway to get primary key values when doing search through Web Service API?
I noticed I might be able to use "AcctCD", which is called "Customer ID" to update, however, I'm not sure whether that Customer ID is unique or not in database, since it is not specified as Primary key...
Any help would be really appreciated.
Thanks.
Your specific question is how to get
BAccountID
, and you can - so I'll answer that question. But you probably do want to work withAcctCD
.This snippet of code builds the command list for
AR303000Export
You'll notice that some interesting things are just not exposed in the strongly typed schema, but still available if you know how to build the command to reference the field. (Such as the type of phone number in
Phone1
being inPhone1Type
).In your case, you need a command to export
BAccountID
from the same internal object name asCustomerID
:WSTools.NewA4Field(AR303000Schema.CustomerSummary.CustomerID.ObjectName, "BAccountID")
in your export command list. (it is 5th in the snippet above).
There are many ways to build the "Field" object - I have a utility method for that:
Hope this helps!