I am trying to create an extension on the PriceDisc class but I am receiving an error saying the compiler terminated abnormally. The environment is PU29. I saw an earlier post about someone needing to rebulid the solution before creating the extension. I tried doing that without any success. The following code is what I am currently working with. I extended the updateDiscountFromPriceDiscTable method to try to track down the source of the error. If only that method is present in the class, it will not terminate abnormally. It is when I include code for the buildFindPriceDiscountQuery method which is what I need to extend.
Can anyone see what I am doing wrong?
[ExtensionOf(classStr(PriceDisc))]
final class XXXPriceDisc_Extension
{
protected internal void updateDiscountFromPriceDiscTable(PriceDiscTable _priceDiscTable)
{
next updateDiscountFromPriceDiscTable(_priceDiscTable);
}
protected internal Query buildFindPriceDiscountQuery(PriceType _relation,
InventDimId _inventDimId,
PriceDiscProductCodeType _itemCode,
ItemId _itemRelation,
PriceDiscPartyCodeType _accountCode,
CustVendAC _accountRelation,
UnitOfMeasureSymbol _unitId)
{
next buildFindPriceDiscountQuery(_relation, _inventDimId, _itemCode, _itemRelation, _accountCode, _accountRelation, _unitId);
}
}
Severity Code Description Project File Line Suppression State
Error Abnormal termination with unhandled exception. Exception key: 7cef4cc8-5095-402d-9ce6-592e9f8d6b37. System.ArgumentNullException: Value cannot be null.
Parameter name: type1
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeHandler.SameType(SemanticType type1, SemanticType type2)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolver.ValidateChainOfCommandMethod(ModelElement augmentedModelElement, Method method, MethodOrDelegate targetMethodOrDelegate)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolver.ValidateChainOfCommandMethodSignature(SymbolTable payload, Method method)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolver.VisitMethod(SymbolTable payload, Method method)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.ClassTypeResolver.VisitMethod(SymbolTable payload, Method method)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitMethodOrDelegate(TPayload payload, MethodOrDelegate methodOrDelegate)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitorWithDiagnostics`2.VisitMethodOrDelegate(TPayload payload, MethodOrDelegate methodOrDelegate)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolver.VisitMethodOrDelegate(SymbolTable payload, MethodOrDelegate methodOrDelegate)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitMethods(TPayload payload, IEnumerable`1 methodOrDelegates)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitMethods(TPayload payload, IDictionary`2 dictionary)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitClass(TPayload payload, Class class_)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolver.VisitClass(SymbolTable payload, Class classInstance)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.ClassTypeResolver.VisitClass(SymbolTable payload, Class classInstance)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitClassOrInterface(TPayload payload, ClassOrInterface classOrInterface)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitorWithDiagnostics`2.VisitClassOrInterface(TPayload payload, ClassOrInterface classOrInterface)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitModelElement(TPayload payload, ModelElement modelElement)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolver.VisitModelElement(SymbolTable payload, ModelElement modelElement)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitCompilationUnit(TPayload payload, CompilationUnit compilationUnit)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitorWithDiagnostics`2.VisitCompilationUnit(TPayload payload, CompilationUnit compilationUnit)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.TypeResolverPipelineEntry.Execute(CompilationUnit compilationUnit, TypeResolver resolver)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.Pipeline.ExecutePipeline(CompilationUnit compilationUnit, IDiagnosticSink diagnostics, IXppcMetadataProvider metadataProvider, Stack`1 context)
at Microsoft.Dynamics.AX.Framework.Xlnt.XppParser.Pass2.MultipassAdministrator.RunPipeline(CompilationUnit compilationUnit, Pipeline pipeline)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ClassTypeGenerator.<>c__DisplayClass6_0.<RunPipeline>b__0(String name)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.ParallelCrashDumpUtil.<>c__DisplayClass1_0`1.<ForEach>b__2(T t)
at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.<PartitionerForEachWorker>b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ). XXX000941_TradeAgreementFields (VAR) [XXX] C:\AOSService\PackagesLocalDirectory\XXX\XXX\AxClass\XXXPriceDisc_Extension.xml 0
Error Compilation failed. 0
Error X++ compiler exited unexpectedly with failure code -1. 1