Hello! The below code is running great in 25R1. It tells the system to look at the UsrQUOTECOST field on SOLine when create a PO through Create Purchase Order. If UsrQUOTECOST is empty, then system should behave the same, if user inputs value in UsrQUOTECOST, then when PO is created, the unit cost field should pull from this udf.
The issue I am running into is that when I try to publish this code in a 25R2 tenant, I get the following error: The PX.Objects.PO.POLine FindOrCreatePOLine(PX.Objects.PO.POOrderEntry, PX.Objects.CS.DocumentList`1[PX.Objects.PO.POLine], System.String, PX.Objects.PO.POFixedDemand, SOLineSplit3, FindOrCreatePOLineDelegate) method in the PX.Objects.PO.POCreate_Extension graph extension is marked as [PXOverride], but no original method with this name has been found in PXGraph.
And per the 25R2 developer release notes, looks like the FindOrCreatePOLine method was removed. Any ideas around what the alternative method would be to make this code work? Open to any suggestions, thank you all!
#region Event Handlers
public delegate POLine FindOrCreatePOLineDelegate(POOrderEntry docgraph, DocumentList<POLine> ordered, String orderType, POFixedDemand demand, SOLineSplit3 soline);
[PXOverride]
public POLine FindOrCreatePOLine(POOrderEntry docgraph, DocumentList<POLine> ordered, String orderType, POFixedDemand demand, SOLineSplit3 soline, FindOrCreatePOLineDelegate baseMethod)
{
// Call the base method to get or create the POLine
POLine poLine = baseMethod(docgraph, ordered, orderType, demand, soline);
if (poLine != null && soline != null)
{
// Fetch the associated SOLine using its line reference
SOLine soLine = PXSelect<SOLine,
Where<SOLine.orderType, Equal<Required<SOLine.orderType>>,
And<SOLine.orderNbr, Equal<Required<SOLine.orderNbr>>,
And<SOLine.lineNbr, Equal<Required<SOLine.lineNbr>>>>>>
.Select(docgraph, soline.OrderType, soline.OrderNbr, soline.LineNbr);
if (soLine !=null)
{
// Retrieve the extensions
var soLineExt = PXCache<SOLine>.GetExtension<SOLineExt>(soLine);
if (soLineExt != null && soLineExt.UsrQUOTECOST.HasValue && soLineExt.UsrQUOTECOST.Value > 0m)
{ poLine.CuryUnitCost = soLineExt.UsrQUOTECOST;
}
}
}
return poLine;
}
#endregion