Hi Everyone,
When we are converting the Sale Quote to Sales Order, we are updating few custom fields and implemented with the below logic it is working fine, but when we have same line items and could not able to identify the unique line and values are not copying from Sales Quote to Sales Order.
can anyone help me with this?
I know that As I comparing only Inventory ID, then I’m seeing this issue but is there any field that we can identify uniquely?
public class QuoteMaintExt : PXGraphExtension<QuoteMaint.CRCreateSalesOrderExt, QuoteMaint>
{
public static bool IsActive() => true;
>PXOverride]
public IEnumerable createSalesOrder(PXAdapter adapter, Func<PXAdapter, IEnumerable> baseMethod)
{
PXGraph.InstanceCreated.AddHandler(delegate (SOOrderEntry graph)
{
graph.RowUpdated.AddHandler<SOLine>(delegate (PXCache sender, PXRowUpdatedEventArgs e)
{
SOLine objSOLine = e.Row as SOLine;
if (objSOLine != null)
{
SOLineExt objLineExt = objSOLine.GetExtension<SOLineExt>();
foreach (CROpportunityProducts item in Base.Products.Select().FirstTableItems.ToList().Where(x => x.InventoryID == objSOLine.InventoryID))
{
CROpportunityProductsExt objItemExt = item.GetExtension<CROpportunityProductsExt>();
sender.SetValue<SOLineExt.usrTestField1>((object)objSOLine, objItemExt.UsrTestField1);
sender.SetValue<SOLineExt.usrTestField2>((object)objSOLine, objItemExt.UsrTestField2);
}
}
});
});
return baseMethod(adapter);
}
}