Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Module has invalid reference to module

Posted on by 685

I'm involved in a migration from Ax2012 R3 CU10 to Dynamics 365 for Finances and Operations Enterprise (formerly Dynamics 365 for Operations, D3FO for now).

I cannot add AOT objects (specifically, class CustomerInvoiceSubledgerJournalTransferCommandExtension) to none of the models (option "Add to project" appears greyed). So I suppose I must manage something with models. Well, when I click Dynamics 365 - Model Management - Create model / Update model parameters, this message appears:
Module "ApplicationSuite" has invalid reference to module "Expense" that can cause circular dependencies. This is an indication thath model store is in a broken state.

Any ideas or advices to solve this?

*This post is locked for comments

  • Verified answer
    RE: Module has invalid reference to module

    I finally managed to figure how to add this class to the customization project.

    Go to K:\AosService\PackagesLocalDirectory\ApplicationSuite\ApplicationSuite.[ModelInAx2012]\AxClass\Delta

    Create file CustomerInvoiceSubledgerJournalTransferCommandExtension.xml with this content:

    <?xml version="1.0" encoding="utf-8"?>

    <AxClassDelta xmlns:i="www.w3.org/.../XMLSchema-instance&quot;>

    <Conflicts />

    <DeltaName>SubledgerJournalTransferCommand</DeltaName>

    </AxClassDelta>

    Go to your project folder with model, in my case C:\Users\eqmdeveloper1\Documents\Visual Studio 2015\Projects\UpgradedSolution\ApplicationSuite.[ModelInAx2012], and modify ApplicationSuite.EXC_ECUADOR_LOC_VAR.rnrproj

    Add node where appropiate (look for some examples in same file):

       <Content Include="AxClass\CustomerInvoiceSubledgerJournalTransferCommandExtension">

         <SubType>Content</SubType>

         <Name>CustomerInvoiceSubledgerJournalTransferCommandExtension</Name>

         <Link>Classes\CustomerInvoiceSubledgerJournalTransferCommandExtension</Link>

       </Content>

    Save all and reopen project in VS. Voilá!!

  • Verified answer
    RE: Module has invalid reference to module

    I solved the model reference issue thanks to this link:

    community.dynamics.com/.../232128

    I found that 2 of the models created by the LCS migration tools referenced a non-existing module called "Expense". So I deleted its references, reopened VS and voilá.

    About the CustomerInvoiceSubledgerJournalTransferCommandExtension object, what I really want is to add it to one of the projects so I can customize it.

    I have 3 solutions, with different models created by LCS Migration Tool. As example, I have the "UpgradesSolution" with 6 folders. One of them is ApplicationSuite, where is the ApplicationSuite.[NameOfTheModelInAx2012] project, belonging to "Application Suite [NameOfTheModelInAx2012]" model. Inside, among others, is the folder "Classes" where I see, per example, the class "BankVoucher [c]". Note that the original class belongs to the same Application Suite model, as CustomerInvoiceSubledgerJournalTransferCommandExtension does. And I can customize BankVoucher freely, but I can do nothing with CustomerInvoiceSubledgerJournalTransferCommandExtension...

    PS: thanks for your quick answer, I appreciate that!!

  • Sohaib Cheema Profile Picture
    Sohaib Cheema 46,610 User Group Leader on at
    RE: Module has invalid reference to module
    • If you are trying to extend an element, look on the element that you are trying to extend, take note of what is the package that the element belongs and update your package to have the referenced package linked to that one. To create extension to your new package, the package of the element that you are trying to extend has to be “referenced” on your package.

       

    • If you are trying to customize an object, make a note that you cannot customize an object, outside a package. If, you want to customize an object of “PackageA”, make sure, your current project belong to a model, which has access to “PackageA”

     

    Regarding circular reference, please note that if a model refers to another model then the other cannot refer to first one. As you are getting error for circular reference, that means your model 'Expense'  already refers to application suite. You can omit this issue of circular reference by introducing a third package, where you can refer both packages and can use code of both in a third package/model. But this is not a must to use third package. It all depends upon what you are trying to do.

     

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templates⚡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,188 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,030 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans