Skip to main content

How-TO: Import Sales Order Lines custom field with Commerce Connector

  • October 8, 2020
  • 2 replies
  • 639 views

smarenich
Acumatica Moderator
Forum|alt.badge.img+3
  • Acumatica Commerce Edition Team Lead

Acumatica Commerce Connector does not allow mapping of the custom fields for the Sales Order Lines using Entity mapping screen, however, you can use customization engine and include custom fields.

To do so, you can create an extension for the Sales Order Processor and include the SO Line custom fields in the API Object.

//BCSalesOrderProcessor is the main class that does synchronization of the Sales Orders
public class BCSalesOrderProcessorExt : PXGraphExtension<BCSalesOrderProcessor>
{
public delegate void MapBucketImportDelegate(BCSalesOrderBucket bucket, IMappedEntity existing);

//MapBucketImport is mapping the eCommerce API object to Acumatica API Object.
[PXOverride]
public void MapBucketImport(BCSalesOrderBucket bucket, IMappedEntity existing, MapBucketImportDelegate baseMethod)
{
baseMethod(bucket, existing);

foreach (var detrow in (IEnumerable<SalesOrderDetail>)bucket.Order.Local.Details)
{
detrow.Custom = new CustomField[]
{
new CustomStringField()
{
ViewName = "Transactions", //Dataview name for the sales order details
FieldName = "UsrField", //Custom field name
Value = "Test1" // Custom field value
}
}.ToList();
}
}
}

Hope it helps!

2 replies

  • Freshman I
  • September 28, 2021

Is it possible to do this in Shopify as well?


plambert
Semi-Pro I
Forum|alt.badge.img+2
  • Semi-Pro I
  • August 22, 2025

Is it possible to extract the value from a BigCommerce Custom Field? 
Say if there is an Acumatica attribute on the item ‘FIXEDVALUE’ that is auto-mapped to a BigCommerce Custom Field named ‘ACU Fixed Value’ and we would like to update the Sales Order line custom field with that ‘ACU Fixed Value’ custom field’s value. Is that accessible from the BC bucket details? What would the structure be?
bucket.Order.Local.Details.[Custom Field Name?]
bucket.Order.Local.Details.CustomFields.[Custom Field Name?]
 

Thank you for any insight you can provide,