有什么方法可以在搜索企业帐户时获取BAccountID,或通过Web Service API基于这些主键更新企业帐户? [英] Is there any way to get BAccountID when searching Business Account, or update Business Account based on those primary keys through Web Service API?

查看:74
本文介绍了有什么方法可以在搜索企业帐户时获取BAccountID,或通过Web Service API基于这些主键更新企业帐户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在研究一个项目,该项目将通过Web Service API将电子商务订单传递到Acumatica。

We were working on a project that would pass our e-commerce orders into Acumatica through Web Service API.

作为订购过程的一部分,我们需要搜索客户以获得所需的商品,然后我们希望能够根据此客户数据进行更改在主键上,即BAccountID;但是,当我使用Web服务API AR303000Export获取客户信息时,在从Acumatica获取的数据中没有看到 BAccountID,因此,我无法基于主键(BAccountID和CompanyID,我们已经有了CompanyID。)

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).

通过Web Service API进行搜索时是否还能获取主键值?

Is there anyway to get primary key values when doing search through Web Service API?

我注意到我可以使用 AcctCD(称为客户ID)进行更新,但是,我不确定该客户ID在数据库中是否唯一,因为未指定作为主键...

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...

任何帮助将不胜感激。

谢谢。

推荐答案

您的特定问题是如何获取 BAccountID ,您可以-因此,我将回答这个问题。但是您可能确实希望使用 AcctCD

Your specific question is how to get BAccountID, and you can - so I'll answer that question. But you probably do want to work with AcctCD.

此代码段为<$ c构建命令列表$ c> AR303000Export

   var commandgroup = new Command[]
        {
                AR303000Schema.CustomerSummary.ServiceCommands.EveryCustomerID
            ,   WSTools.NewA4Field(AR303000Schema.CustomerSummary.CustomerID.ObjectName, "DefContactID") 
            , AR303000Schema.CustomerSummary.CustomerID 
            , AR303000Schema.CustomerSummary.CustomerName 
            ,   WSTools.NewA4Field(AR303000Schema.CustomerSummary.CustomerID.ObjectName, "BAccountID") 
            ,   WSTools.NewA4Field(AR303000Schema.CustomerSummary.CustomerID.ObjectName, "Type") 
            ,AR303000Schema.CustomerSummary.Status 
            , AR303000Schema.GeneralInfoMainContact.Phone1  
            , AR303000Schema.GeneralInfoMainContact.Phone2
            ,   WSTools.NewA4Field(AR303000Schema.GeneralInfoMainContact.Phone1.ObjectName, "Phone1Type") 
            ,   WSTools.NewA4Field(AR303000Schema.GeneralInfoMainContact.Phone1.ObjectName, "Phone2Type") 
            WSTools.NewA4Field(AR303000Schema.CustomerSummary.CustomerID.ObjectName, "LastModifiedDateTime") 

        };

您会注意到,一些有趣的事情并未在强类型模式中公开,但仍然可用如果您知道如何构建用于引用该字段的命令。 (例如 Phone1 中的电话号码类型在 Phone1Type 中)。

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 in Phone1Type).

在您的情况下,您需要一个命令来从与 CustomerID BAccountID >:

In your case, you need a command to export BAccountID from the same internal object name as CustomerID:

WSTools.NewA4Field(AR303000Schema.CustomerSummary.CustomerID.ObjectName, BAccountID)

WSTools.NewA4Field(AR303000Schema.CustomerSummary.CustomerID.ObjectName, "BAccountID")

在您的导出命令列表中。 (在上面的代码段中是第5位。)

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:

  public static AcumaticaWS.Field NewA4Field(string objName, string fldName)
    {
        AcumaticaWS.Field nv = new AcumaticaWS.Field();
        nv.ObjectName = objName;
        nv.FieldName = fldName.TrimEnd();
        return nv;
    }

希望这会有所帮助!

这篇关于有什么方法可以在搜索企业帐户时获取BAccountID,或通过Web Service API基于这些主键更新企业帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆