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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Error When Invoicing a PO: Stack trace: The company (VirtualCompany) does not exist.

(0) ShareShare
ReportReport
Posted on by 587

Hello all,

When invoicing a PO where the customers and vendors are in a virtual company the below error is received.

Here are the steps I have carried out already

  • Running version 6.2.1000.6278
  • Have completed a full compile, full CIL and database synch with no errors.
  • AOS restarted with usage data and AUC files cleared.
  • Confirmed that the relevant customer and vendor tables are shared per TechNet.
  • KB 2917305 is already applied as part of CU7.
  • Also get same error when creating a vendor invoice.

Does anyone have other suggestions to look at to get this resolved?

The infolog is here:

Stack trace: The company (VirtualCompany) does not exist.

Removal of suspension of recId allocation for table VendInvoiceInfoTable has failed.

 

 

Stack trace

 

(S)\Data Dictionary\Tables\VendTable\Methods\findByCompany - line 27

(S)\Data Dictionary\Tables\VendTable\Methods\getDefaultRemittanceLocation - line 20

(S)\Classes\VendDocumentTableType_Invoice\determineDefaultRemittanceLocation - line 3

(S)\Classes\VendDocumentTableType\defaultRemittanceLocation - line 8

(S)\Classes\VendDocumentTableType\defaultRow - line 62

(S)\Data Dictionary\Tables\VendInvoiceInfoTable\Methods\defaultRow - line 29

(S)\Classes\PurchFormletterParmData\defaultParmTable - line 4

(S)\Classes\PurchFormletterParmData\createParmTable - line 52

(S)\Classes\PurchFormletterParmDataInvoice\createParmTable - line 66

(S)\Classes\formletterParmData\doChooseLines - line 114

(S)\Classes\formletterParmData\selectChooseLines - line 16

(S)\Classes\PurchFormletterParmDataInvoice\selectChooseLines - line 27

(S)\Classes\formletterParmData\createData - line 47

(S)\Classes\PurchFormletterParmDataInvoice\createData - line 3

(S)\Classes\PurchFormletterParmDataInvoice\chooseLinesServerIL - line 32

(S)\Classes\DictClass\callStatic

(S)\Classes\SysDictClass\invokeStaticMethod - line 26

(S)\Classes\SysDictClass\invokeStaticMethodIL - line 39

(S)\Classes\Global\runClassMethodIL - line 30

(S)\Classes\PurchFormletterParmDataInvoice\chooseLinesServer - line 21

(S)\Classes\PurchFormLetter_Invoice\chooseLinesServer - line 3

(S)\Classes\PurchFormLetter\chooseLines - line 26

(S)\Classes\PurchFormLetter_Invoice\chooseLines - line 10

(S)\Classes\PurchFormLetter\initLinesQuery - line 3

(S)\Classes\PurchFormLetter\prePromptInit - line 21

(S)\Classes\PurchFormLetter\mainOnServer - line 218

(C)\Classes\PurchFormLetter\main

(C)\Classes\FormFunctionButtonControl\Clicked

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi Sergi,

    Can you check if the hotfix is really installed correctly? Can you see if the KB number is  visible in the list of models?

    You can also check the method determineDefaultRemittanceLocation in the class VendDocumentTableType_Invoice. Are the changes as shown on LCS issue search visible here?

  • SergiPB Profile Picture
    587 on at

    Hello André,

    I looked at the methods and the did a compare and it is as it should be including on the determineDefaultRemittanceLocation method, the CU7 KB is showing as the model.

    No customizations are on this class.

    I want to add that I have unchecked the "execute in CIL" checkbox and get the same results.

  • SergiPB Profile Picture
    587 on at

    **Update** I have resolved this by reverting a piece of the CU7 hotfix on the getdefaultRemitanceLocation method on the VendTable.

    POInvoiceFix.jpg

    I have just commented out the CU7 change and reverted back to the base code.

    // VendTable      vendTable = VendTable::findByCompany(_company, _accountNum); //KB 2885603

    VendTable      vendTable = VendTable::find(_accountNum);  //Base

    The new issues is I still receive an error when I try to invoice, when I uncheck the Execute in CIL box all works as expected. I have ran a full X++ compile, deleted all the XPPIl files, regenerated the CIL, deleted the AUC cache files and cleared usage data. All with no errors. but the problem persists only when the CIL box is checked.

    Anyone have ideas to look at to resolve this?

    Will update when I find out the cause of this.

    1. Removal of suspension of recid allocation for table VendInvoiceInfoTable has failed.

    2. Microsoft.Dynamics.Ax.Xpp.ErrorException: Exception of type 'Microsoft.Dynamics.Ax.Xpp.ErrorException' was thrown.
       at Dynamics.Ax.Application.SysRecIdSequence.Removerecidsuspension(Int32 _tableId) in SysRecIdSequence.removeRecIdSuspension.xpp:line 23
       at Dynamics.Ax.Application.formletterParmData.Removerecidsuspension() in formletterParmData.removeRecIdSuspension.xpp:line 15
       at Dynamics.Ax.Application.formletterParmData.Catchall() in formletterParmData.catchAll.xpp:line 9
       at Dynamics.Ax.Application.formletterParmData.Createdata(Boolean _append, Boolean ) in formletterParmData.createData.xpp:line 63
       at Dynamics.Ax.Application.formletterParmData.Createdata(Boolean _append)
       at Dynamics.Ax.Application.PurchFormletterParmDataInvoice.Createdata(Boolean _append, Boolean ) in PurchFormletterParmDataInvoice.createData.xpp:line 3
       at Dynamics.Ax.Application.PurchFormletterParmDataInvoice.Createdata(Boolean _append)
       at Dynamics.Ax.Application.PurchFormletterParmDataInvoice.chooseLinesServerIL(Object[] _pack) in PurchFormletterParmDataInvoice.chooseLinesServerIL.xpp:line 32
       at PurchFormletterParmDataInvoice::chooseLinesServerIL(Object[] )
       at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
       at Dynamics.Ax.Application.SysDictClass.invokeStaticMethod(Object[] _params) in SysDictClass.invokeStaticMethod.xpp:line 26
       at SysDictClass::invokeStaticMethod(Object[] )
       at Microsoft.Dynamics.Ax.Xpp.ReflectionCallHelper.MakeStaticCall(Type type, String MethodName, Object[] parameters)
       at Microsoft.Dynamics.Ax.Xpp.PredefinedFunctions.runAsInvoke(String className, String staticMethodName, Object[] parms, Object[]& exportInfolog)
  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi Sergi,

    Have you also restarted all AOS instances of this environment after generating the CIL? The CIL completed without errors?

  • SergiPB Profile Picture
    587 on at

    This is a sandbox AOS and only one exists in this environment and it has been restarted after the CIL was generated and it completed without errors.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans