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 executing code: Wrong argument types in variable assignment. when confirming PO

(0) ShareShare
ReportReport
Posted on by

Hi all,

i have completed an in place upgrade from ax 2012 rtm to ax 2012 r2

but currently i am having the below exception when trying to Confirm a purchase order

Error executing code: Wrong argument types in variable assignment.

Stack trace

(S)\Classes\FormLetterContract\unpack - line 8

(S)\Classes\PurchFormLetterContract\unpack - line 13

(S)\Classes\SysOperationDataContractInfo\unpackDataContractObject - line 21

(S)\Classes\SysOperationController\unpackDataContractInfoObjects - line 34

(S)\Classes\SysOperationController\unpack - line 70

(S)\Classes\SysOperationServiceController\unpack - line 15

(S)\Classes\PurchFormLetter\unpack - line 10

(S)\Classes\PurchFormLetter_PurchOrder\unpack - line 73

(S)\Classes\xSysLastValue\getLast - line 29

(S)\Classes\SysOperationController\loadFromSysLastValue - line 29

(S)\Classes\SysOperationController\getDataContractInfoObjects - line 10

(S)\Classes\SysOperationController\getDataContractInfoObject - line 17

(S)\Classes\SysOperationController\getDataContractObject - line 18

(S)\Classes\FormLetterServiceController\init - line 3

(S)\Classes\PurchFormLetter_PurchOrder\init - line 3

(S)\Classes\PurchFormLetter_PurchOrder\newPurchOrder - line 7

(S)\Classes\PurchFormLetter\construct - line 11

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

(C)\Classes\PurchFormLetter\main - line 50

(C)\Classes\FormFunctionButtonControl\Clicked

i tried to debug it and reached to this point  where exception occurs on     [version, #ParmListFormLetter] = _packedClass; in the FormLetterContract

i tried to clear xppil, do a full compile and CIL generation and sync dictionary but the error still appear i also checked for customization in the classes in the stack trace but all of them are sys layer and free of any customization  

public boolean  unpack(container  _packedClass)

{

   Integer  version = conPeek(_packedClass,1);

   switch (version)

   {

       case #CurrentVersion:

           [version, #ParmListFormLetter] = _packedClass;

           break;

       default :

           return false;

   }

   return true;

}

could any one advice about this

your help is most appreciated

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    If everything is compiled, there must be a real problem in the assignment. It's possible that your code is correct, but the packed variables saved in SysLastValues aren't compatible with the new code. (This problem should be ruled out by using different versions, but maybe something failed there.) If this is the reason, you just need to remove the record with saved values from SysLastValue table.

  • Mohammed Abdul Aziz Profile Picture
    1,875 on at

    I got a similar error when trying to print a PO confirmation copy. I fixed it by deleting user's usage data.
    1. System Admin -> Users
    2. Select user and click on options.
    3. Click on usage data i menu.
    4. Click reset.

  • Suggested answer
    Luqman Profile Picture
    125 on at

    I faced the same error while confirming the sales order, purchase order. It started to occur after upgradation from R2 to R3 version. Had done the following steps:

    1. Full application compiled. (No error found)
    2. Full CIL Generation (No error found)
    3. Reset usage  data from User  options window (that did the trick!).

    Cheers,

    Luqman

  • Suggested answer
    Luqman Profile Picture
    125 on at

    Thanks. It worked for me.

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