Hi All,
In case you have such additional details in your Shopify order and you want to import it into Acumatica with custom field, you can do it with a simple customization.
In Shopify, this data is stored in something that is called Note Attributes
But unfortunately, this data is stored in the Key/Value pair, so it is not easy to map it using the mapping engine.
But we can write the mapping using the code:
public class SPSalesOrderProcessorExt : PXGraphExtension<SPSalesOrderProcessor>
{
public delegate void MapBucketImportDelegate(SPSalesOrderBucket bucket, IMappedEntity existing);
//MapBucketImport is mapping the eCommerce API object to Acumatica API Object.
[PXOverride]
public void MapBucketImport(SPSalesOrderBucket bucket, IMappedEntity existing, MapBucketImportDelegate baseMethod)
{
baseMethod(bucket, existing);
foreach (var detrow in bucket.Order.Extern.NoteAttributes)
{
if (detrow.Name == "Amazon Order Id")
{
if (bucket.Order.Local.Custom == null) bucket.Order.Local.Custom = new List<CustomField>();
bucket.Order.Local.Custom.Add(
new CustomStringField()
{
ViewName = "Document", //Dataview name for the sales order header
FieldName = "UsrField", //Custom field name from the customization
Value = detrow.Value.ValueField()
});
}
}
}
}
Please note, the “FieldName = “UsrField”” - this is the place that you need to change to reflect the name of the custom field you use in Acumatica.
Hope it helps.