hi,
Is there a way to import metafields from BigCommerce to Acumatica?
Best answer by smarenich
View originalhi,
Is there a way to import metafields from BigCommerce to Acumatica?
Best answer by smarenich
View originalAre you talking about importing metafield values or the metafield definitions?
Currently we don’t support it, but you can customize the connector to map it.
Hi
Yes we need to import Order Metafields. Could you please explain in brief how to do it?
The difference is, instead of modifiers you need to get metafields from BigCommerce.
Hope it helps.
Hello,
I have tried to get order metafields using MapBucketImport function but there are no metafields returned, then i try to get through RestApi and it gives error "Object reference not set to an instance of an object." Could you please check my code what i am doing wrong..
public delegate void MapBucketImportDelegate(BCSalesOrderBucket bucket, IMappedEntity existing);
[PXOverride]
public void MapBucketImport(BCSalesOrderBucket bucket, IMappedEntity existing, MapBucketImportDelegate baseMethod)
{
baseMethod(bucket, existing);
MappedOrder obj = bucket.Order;
OrderData data = obj.Extern;
SalesOrder impl = obj.Local;
BCSalesOrderProcessor _processor = PXGraph.CreateInstance();
var client = BCConnector.GetRestClient(_processor.GetBindingExt());
orderMetaFieldDataProvider = new OrderMetaFieldRestDataProvider(client);
data.MetaFields = orderMetaFieldDataProvider.GetAll(new FilterOrderMetaField { }, bucket.Order.ExternID).ToList() ?? new List();
if (data?.MetaFields != null)
{
foreach (var option in data.MetaFields)
{
}
}
}
Hi
I have noticed 2 problems:
First
BCSalesOrderProcessor _processor = PXGraph.CreateInstance();
Please do not create a new graph, it will significantly slow down the performance, you can use instead
var client = BCConnector.GetRestClient(Base.GetBindingExt());
Second, you may need to pass some parameters to filter, I have noticed we are passing namespace and key to get metafields
orderMetaFieldDataProvider.GetAll(new FilterOrderMetaField { Key = BCObjectsConstants.ImportedInAcumatica, NameSpace = BCObjectsConstants.Namespace_Global }, syncstatus.ExternID).ToList()
Also please test metafields request with your store using postman or https://developer.bigcommerce.com/api-reference/b3A6MzU5MDQ4MzE-get-metafields.
For instance your token may not have access rights to metafields.
If you still get a NullReferenceExceltion, please add here stack trace of the error.
Hi,
Sorry for late reply. Thanks it worked :)
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.