Microsoft Dynamics AX 2009: Error executing code: Wrong argument types in variable assignment

StackOverflow https://stackoverflow.com/questions/3625540

  •  26-09-2019
  •  | 
  •  

Question

I have added an object member to InventMovement class and have created one parameter method for the same but following line of code is popping up above error:

movement.parmProdJournalId(this.JournalId);

JournalId parmProdJournalId(JournalId _prodJournalId = prodJournalId)
{
    ;
    prodJournalId =  _prodJournalId;
    return prodJournalId;
}

After adding the object member and parameter method I have also compile forward InventMovement but no success. Will appreciate if anyone of you could help me in this regard

Rgds

PS: I am doing the same thing which is mentioned in this blog post: http://www.artofcreation.be/2009/04/04/wrong-argument-types-in-variable-assignment/

Was it helpful?

Solution

I stopped the AOS, renamed AXAPD.AOI file and restarted the AOS. This resolved the problem. I got this solution from other forum where also I posted this question.

OTHER TIPS

It is kind of strange, should work.
I could not reproduce your problem, but once had a similar problem. Solved it by re-compiling and synchronizing every involved class and table (more than once).
Also make sure nobody else is using any of these objects, maybe best is to restart the AOS.

EDIT (after comment on question):
Another possibility: it seams that you are also mixing JournalId and ProdJournalId.
I think the parameter and return value of parmProdJournalId should also be ProdJournalId.
Just try this one:

ProdJournalId parmProdJournalId(ProdJournalId _prodJournalId = prodJournalId)
{
    ;
    prodJournalId =  _prodJournalId;
    return prodJournalId;
}

could not try it myself since I could'nt reproduce the error

If you can't restart the AOS, delete the local cache files of the client might work, i.e. *.auc from: C:\Documents and Settings\Local Settings\Application Data

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top