【问题标题】:Acumatica CustomFields not working on sales order createAcumatica CustomFields 不适用于创建销售订单
【发布时间】:2017-08-03 19:16:17
【问题描述】:

我正在通过 ASP.net 进行 Acumatica 集成,该集成通过基于合同的 API 在 Acumatica 中创建销售订单。我使用的是 5.30 版。某些字段是 Acumatica 对象的标准字段,而有些字段则不是。对于那些不存在的,我看到了here 使用 CustomFields 属性的方法,您可以在创建销售订单时向这些字段添加数据。这对 SalesOrder 对象很有用,但是,当我在 Contact 对象上尝试此操作时,它不起作用。我正在尝试更新 SalesOrder 的运输设置选项卡上的“注意”字段。您可以在下图中看到该字段映射到“Salutation”数据字段。

我尝试通过 CustomFields 属性更新此字段,但它不起作用:

orderToBeCreated = new SalesOrder
{
    OrderType = new StringValue { Value = "SO" },
    CustomerID = new StringValue { Value = customerID },
    Description = new StringValue { Value = orderDescription },
    CustomerOrder = new StringValue { Value = order.order_number.ToString() },
    ExternalReference = new StringValue { Value = externalReference },
    Details = orderDetails.ToArray<SalesOrderDetail>(),
    ShippingAddressOverride = new BooleanValue { Value = true },
    ShippingContactOverride = new BooleanValue { Value = true },
    ShippingContact = new Contact()
    {
        DisplayName = new StringValue { Value = order.shipping_address.company },
        FirstName = new StringValue { Value = order.shipping_address.first_name },
        LastName = new StringValue { Value = order.shipping_address.last_name },
        Email = new StringValue { Value = order.customer.email },
        Phone1 = new StringValue {
            Value = (order.billing_address.phone.Length > 0) ? order.billing_address.phone : "-"
        },
        Address = new Address()
        {
            AddressLine1 = new StringValue { Value = order.shipping_address.address_1 },
            AddressLine2 = new StringValue { Value = order.shipping_address.address_2 },
            City = new StringValue { Value = order.shipping_address.city },
            State = new StringValue { Value = order.shipping_address.state },
            Country = new StringValue { Value = order.shipping_address.country },
            PostalCode = new StringValue { Value = order.shipping_address.postcode }
        },
        CustomFields = new CustomField[]
        {
            new CustomStringField
            {
                Name = "Salutation",
                Value = new StringValue { Value = order.shipping_address.first_name + " " + order.shipping_address.last_name },

            }
        }
    },
    ShipVia = new StringValue { Value = _shipViaOptions[order.shipping_methods] },
    CustomFields = new CustomField[]
    {
            new CustomStringField
            {
                Name = "ShipTermsID",
                Value = new StringValue { Value = _shipTermsOptions[order.shipping_methods] }
            }
    }
};

为什么这适用于 ShippingTermsID 而不是 Salutation?

【问题讨论】:

    标签: acumatica


    【解决方案1】:

    在帖子中,您链接到您在哪里看到这项工作,here。 提到这种处理方式适用于 Acumatica 6.00 版及更高版本,而您使用的是 5.30 版。

    虽然幸运在您身边,但您尝试更新的字段位于默认端点中,尽管名称不同。它的名字是“位置”。

    【讨论】:

    • 这行得通。哇.....同一个领域有3个不同的名字......注意、称呼和位置O_o
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-15
    • 2015-09-13
    • 1970-01-01
    • 2023-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多