Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Extension Of Form Meth...
Finance forum
Answered

Extension Of Form Method Init In D365 FO COC

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

  • Verified answer
    Alex VN Profile Picture
    Alex VN 1,987 on at
    RE: Extension Of Form Method Init In D365 FO COC

    Hi,

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

    Thanks

    Anh Ong

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,914 Super User on at
    RE: Extension Of Form Method Init In D365 FO COC

    Hi Agha,

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

  • Verified answer
    huijij Profile Picture
    huijij 19,803 on at
    RE: Extension Of Form Method Init In D365 FO COC

    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.

  • Agha SirajulDola Profile Picture
    Agha SirajulDola 555 on at
    RE: Extension Of Form Method Init In D365 FO COC

    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

  • huijij Profile Picture
    huijij 19,803 on at
    RE: Extension Of Form Method Init In D365 FO COC

    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
    Agha SirajulDola 555 on at
    RE: Extension Of Form Method Init In D365 FO COC

    Hi Andre

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

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 287,914 Super User on at
    RE: Extension Of Form Method Init In D365 FO COC

    Hi Agha,

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

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,914 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,549 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans