Hi there,
we have a customization where we have overridden the GetBucketForImport method in BCSalesOrderProcessor.cs graph. After overridden we are facing issue at await keyword.
Please refer the below screenshots and code.
Overridden code:
public delegate Task<EntityStatus> GetBucketForImportDelegate(BCSalesOrderBucket bucket, BCSyncStatus syncstatus, CancellationToken cancellationToken);
PXOverride]
public async Task<EntityStatus> GetBucketForImport(BCSalesOrderBucket bucket, BCSyncStatus syncstatus, CancellationToken cancellationToken, GetBucketForImportDelegate baseMethod)
{
OrderData data = await orderDataProvider.GetByID(syncstatus.ExternID);
if (data == null) return EntityStatus.None;
await Task.Yield();
data.OrderProducts = new List<OrdersProductData>();
await foreach (var item in orderProductsRestDataProvider.GetAll(syncstatus.ExternID, cancellationToken))
{
data.OrderProducts.Add(item);
}
MappedOrder obj = bucket.Order = bucket.Order.Set(data, data.Id?.ToString(), data.Id?.ToString(), data.DateModifiedUT.ToDate());
EntityStatus status = Base.EnsureStatus(obj, SyncDirection.Import);
if (status != EntityStatus.Pending && status != EntityStatus.Synchronized && Base.Operation.SyncMethod != SyncMode.Force)
return status;
return status;
}
Base code screenshot:
Thanks in advance.