Question

Error when overriding virtual method


Userlevel 4
Badge

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);



        [PXOverride]

        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”

 


0 replies

Be the first to reply!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved