Calling extends class method in Extension class

Hi, I am currently working on retrieving the CovInventdimField from the ReqTrans table following the explosion of the salesline. The process involves the creation of a new record in both InventDim and ReqTrans tables after the explosion update.

However, I am encountering an issue with the code, as an error stating “Object reference not set to an instance of an object” is being raised. I have included the relevant code snippet below:

[ExtensionOf(classStr(ReqCalcExplode))]
final class ReqCalcExplode_Extension
{
public void run()
{
next run();

    InventDimId _covInventDimId;
    ItemId _itemid;
    ReqTrans _issue, receipt;

    receipt = this.pmfCoCovCreatePlannedOrder(_issue);
    if (!receipt)
    {
        info ("not found");             
    }
    else 
    {
        _itemid = receipt.ItemId ;
        _covInventDimId = receipt.CovInventDimId;
        info(strFmt("CovInventDimId for ItemId %1: %2", _itemid, _covInventDimId));
    }
    
}

}

the class ReqCalcExplode extends ReqCalc class. The method pmfCoCovCreatePlannedOrder is defined in ReqCalc and needs to be invoked successfully.

I appreciate any guidance or insights you can provide to help me pinpoint and address the issue.

Which line of code is throwing the error?

In the line
receipt = this.pmfCoCovCreatePlannedOrder(_issue);

I think you mean it thrown somewhere inside pmfCoCovCreatePlannedOrder() (either directly there is in some other code called from pmfCoCovCreatePlannedOrder()). You’d need to find the actual place. For example, you can look at StackTrace property of the exception.

But I think I see the problem - you didn’t provide any value in _issue variable.

By the way, don’t prefix names of local variables with underscore. That should be used for method parameters only.