web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Extension Of Form Method Init In D365 FO COC

(0) ShareShare
ReportReport
Posted on by 555

Hello,

I am getting this strange Error, am I missing something.

tried to reset IIS (resetiis), compiled the module with DB sync

Severity Code Description Project File Line Suppression State
Error Abnormal termination with unhandled exception. Exception key: 825f3df0-4e8c-46af-8881-d026bf1d3936. System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitNextExpression(Object payload, NextExpression nextExpression)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitEvaluation(TPayload payload, Evaluation evaluation)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitEvaluation(Object payload, Evaluation evaluation)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitExpression(Object payload, Expression expression)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitExpressionStatement(TPayload payload, ExpressionStatement expressionStatement)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitExpressionStatement(Object payload, ExpressionStatement statement)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitStatement(TPayload payload, Statement statement)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitStatement(Object payload, Statement statement)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitStatements(TPayload payload, IEnumerable`1 declarationsAndStatements)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitMethod(Object 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.ILGenerator.ILGeneratorSweeper.VisitMethodOrDelegate(Object payload, MethodOrDelegate methodOrDelegate)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitMethods(TPayload payload, IEnumerable`1 methodOrDelegates)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitMethods(Object payload, IEnumerable`1 methods)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.AstVisitor`2.VisitMethods(TPayload payload, IDictionary`2 dictionary)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorSweeper.VisitClass(Object 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.ILGenerator.ILGeneratorSweeper.VisitModelElement(Object 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.ILGenerator.ILGeneratorPass3Worker.GenerateBodiesInNetmodule(Parameters generatorparameters, String netmoduleName, IXppcMetadataProvider metadataProvider, IDiagnosticSink diagnosticsHandler, NetModuleNameByTypeName netModules, ICrossReferenceProvider xRefProvider)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorPass3Worker.GenerateBodiesInNetmodule(Parameters parameters, String netmoduleName, IXppcMetadataProvider metadataProvider, NetModuleNameByTypeName netModules, FileRollbackHandler fileRollbackHandler, IDiagnosticSink diagnosticsHandler, ICrossReferenceProvider xRefProvider)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorPass3Worker.InvokeInNetmodule(Parameters parameters, String netmoduleName, IXppcMetadataProvider metadataProvider, NetModuleNameByTypeName netModules, FileRollbackHandler fileRollbackHandler, IDiagnosticSink diagnosticsHandler, ICrossReferenceProvider xRefProvider)
at Microsoft.Dynamics.AX.Framework.Xlnt.ILGenerator.ILGeneratorMain.<>c__DisplayClass8_2.<GenerateILImplementation>b__8(String moduleName)
at Microsoft.Dynamics.AX.Metadata.XppCompiler.ParallelCrashDumpUtil.<>c__DisplayClass1_0`1.<ForEach>b__2(T t)
at System.Threading.Tasks.Parallel.<>c__DisplayClass17_0`1.<ForWorker>b__1()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass176_0.<ExecuteSelfReplicating>b__0(Object ).

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    306,854 Super User 2026 Season 2 on at

    Hi Agha,

    You can try to put the keyword 'public' in front of 'final class SalesTableAghaForm_Extension'.

  • Agha SirajulDola Profile Picture
    555 on at

    Hi Andre

    thanks for reply, without public it used to work fine.  anyway still same result

  • huijij Profile Picture
    19,813 on at

    Hi Agha,

    Please try it:

    [ExtensionOf(formStr(SalesTable))]
    final class SalesTable_Form_Extension
    {
        public void init()
        {
            next init();
    
            //customize code goes here
    
        }
    
    }

  • Agha SirajulDola Profile Picture
    555 on at

    hello Judy,

    its was my code in first place, however i put public classifier as per mr  Andre recommendation. but the error is still  the same

  • Verified answer
    huijij Profile Picture
    19,813 on at

    Hi Agha,

    Adding method definitions is done in the same way as the base class, and this is the rule that all Chain Of Command classes must follow. In your code, the init() method is written as Init(), which causes the system not to find the method, so it reports an error.

  • André Arnaud de Calavon Profile Picture
    306,854 Super User 2026 Season 2 on at

    Hi Agha,

    Can you try to add additional coding? You now only have the 'next' command, but no actual coding.

  • Verified answer
    Alex VN Profile Picture
    1,994 on at

    Hi,

    I think because you have Capital letter on Init, it should be init in lower case. Please check.

    Thanks

    Anh Ong

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 330 Most Valuable Professional

#2
CU10121822-0 Profile Picture

CU10121822-0 310

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 242 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans