Acumatica CustomFields无法在销售订单上创建 [英] Acumatica CustomFields not working on sales order create

查看:68
本文介绍了Acumatica CustomFields无法在销售订单上创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过ASP.net进行Acumatica集成,该集成通过基于合同的API在Acumatica中创建销售订单。我正在使用5.30版。在Acumatica对象上,有些字段是标准字段,有些不是。对于那些不存在的对象,我在



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

  orderToBeCreated =新的SalesOrder 
{
OrderType =新的StringValue {值= SO},
CustomerID =新的StringValue {值= customerID},
描述=新的StringValue {值= orderDescription},
CustomerOrder =新的StringValue {值= order.order_number.ToString()},
ExternalReference =新的StringValue {Value = externalReference},
Details = orderDetails.ToArray< SalesOrderDetail> (),
ShippingAddressOverride =新的BooleanValue {值= true},
ShippingContactOverride =新的BooleanValue {值= true},
ShippingCont行为=新的Contact()
{
DisplayName =新的StringValue {值= order.shipping_address.company},
FirstName =新的StringValue {值= order.shipping_address.first_name},
LastName =新的StringValue {值= order.shipping_address.last_name},
电子邮件=新的StringValue {值= order.customer.email},
Phone1 =新的StringValue {
Value =(订单.billing_address.phone.Length> 0)? order.billing_address.phone:-
},
地址=新地址()
{
AddressLine1 =新StringValue {值= order.shipping_address.address_1},
AddressLine2 =新的StringValue {值= order.shipping_address.address_2},
市=新的StringValue {值= order.shipping_address.city},
State =新的StringValue {值= order.shipping_address.state },
国家=新的StringValue {值= order.shipping_address.country},
邮政编码=新的StringValue {值= order.shipping_address.postcode}
},
CustomFields =新CustomField []
{
新的CustomStringField
{
名称= Salutation,
Value =新的StringValue {值= order.shipping_address.first_name + +订单.shipping_address.last_name},

}
}
},
ShipVia =新的StringValue {值= _shipViaOptions [order.shipping_methods]},
CustomFields =新的CustomField []
{
新的CustomStringField
{
名称= ShipTermsID ,
值=新的StringValue {值= _shipTermsOptions [order.shipping_methods]}
}
}
};

为什么这对于ShippingTermsID而不是称呼有效?

解决方案

在帖子中,您可以在


I'm working on an Acumatica integration through ASP.net that creates Sales Orders in Acumatica via the contract based API. I am using version 5.30. There are certain fields that come standard on the Acumatica objects, and some that don't. For those that don't exist, I was shown a way here using the CustomFields property that you can add data to these fields when a sales order is created. This worked great for the SalesOrder object, however, when I tried this on the Contact object, it does not work. I am trying to update the "Attention" field on the shipping settings tab of a SalesOrder. You can see in the image below that this field maps to the "Salutation" data field.

I try to update this field via the CustomFields property but it does not work:

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] }
            }
    }
};

Why would this work for ShippingTermsID and not for Salutation?

解决方案

In the post you link for where you saw this work, here. it is mentioned that this way of doing things work for Acumatica Version 6.00 and higher, while you are on version 5.30.

Though Luck is on your side, the field you are trying to update is in the default endpoint though it was name differently. Its name is "Position".

这篇关于Acumatica CustomFields无法在销售订单上创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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