Skip to main content

I'm trying to override the following method in BOMCostRoll.cs:

 

protected virtual decimal? GetUnitCostFromINItemSite(INItemSite inItemSite)
{
return GetUnitCostFromINItemSiteTable(inItemSite);
}

 

Here is my override code:

using PX.Data;

using PX.Objects.IN;



namespace PX.Objects.AM

{

    //Use last cost instead of average or standard cost for cost rolls on BOM's.

    PXProtectedAccess]

    public abstract class GetUnitCostFromINItemCost_Ext : PXGraphExtension<BOMCostRoll>

    {        

        public delegate decimal? GetUnitCostFromINItemCostDelegate(INItemCost inItemCost);



        bPXOverride]

        public virtual decimal? GetUnitCostFromINItemCost(INItemCost inItemCost, GetUnitCostFromINItemCostDelegate baseMethod)

        {

            {

                if (inItemCost != null &&  inItemCost.LastCost != null)

                {

                   

                    return inItemCost.LastCost;

                   

                }

            }

            return null;

        }

    }

}

This is the error I get, no matter what I do:

No matter which method of overriding I’ve tried, I get an error “Value Cannot be Null, Parameter: con”

 

Be the first to reply!

Reply