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)

Wrong type in field number when printing Pro forma purchase order

(0) ShareShare
ReportReport
Posted on by 1,245

Hi all,

I'm using AX 2012 Feature pack with CU3 

Kernel version: 6.0.1108.670

Application version: 6.0.1108.670

Solution version: 6.1.1108.670

Whenever I print Pro forma purchase order the system show error like this:

Error executing code: Wrong type in field number.

Stack trace

(C)\Classes\PSAPurchaseOrderController\runPrintMgmt - line 15

(C)\Classes\SrsPrintMgmtController\run - line 14

(C)\Classes\SysOperationController\startOperation - line 8

(C)\Classes\SrsReportRunController\startOperation - line 9

(C)\Classes\SrsPrintMgmtController\startOperation - line 14

(C)\Classes\SrsPrintMgmtFormLetterController\startOperation - line 14

..

(C)\Classes\FormLetterServiceController\afterOperationBody - line 6

(C)\Classes\FormLetterServiceController\afterOperation - line 7

(C)\Classes\SysOperationServiceController\run - line 70

(C)\Classes\FormLetterServiceController\run - line 3

(C)\Classes\PurchFormLetter\run - line 36

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

(C)\Classes\FormFunctionButtonControl\Clicked

Have any one face this issue? Please help me.

Thanks in advance

*This post is locked for comments

I have the same question (0)
  • Nick Hulbert Profile Picture
    195 on at

    hi, I'm experiencing the same issue. Did you resolve this?

  • Suggested answer
    Klaas Deforche Profile Picture
    2,433 on at

    Try replacing this:

    if (this.parmArgs().record().TableId == tableNum(PurchTable))

    by

    if (this.parmArgs().dataset() == tableNum(PurchTable))

    I haven't tested it yet, but I'll do and let you know.

    Please let us know if it works for you.

  • Nick Hulbert Profile Picture
    195 on at

    Thanks, that works perfectly. Looks like this was a bug brought in by CU3.

    I was thinking it might be a simple fix but wanted to make sure that those args weren't not being populated somewhere else they should have been.

    Great blog by the way. Your SysOp posts were so helpful and I still refer to your "Creating a class, the best practice way" post.

  • Klaas Deforche Profile Picture
    2,433 on at

    Hi Nick,

    Glad I could help. It's funny, I was just assigned this issue when I saw this post.

    It's indeed something that is new to CU3.

    Personally, I don't like using "args.record().TableId". I never do it anymore, but I used to do it like this to avoid these stack traces: "args && args.record() && args.record().TableId". Using the dataset() method is much nicer I think.

    I hope this is all there is to it, but I'll look into it and probably log a case with MS for this, this is clearly a bug.

    Glad I could help with my blog, it's always nice to hear people are finding it useful.

  • Trung Nguyen Profile Picture
    1,245 on at

    Thanks for your great help.

    I see a lot of code like this  "args.record().TableId" in CU3, I afraid it will cause error in another place. I wonder  is there any hotfix from MS

    Regards,

    Trung

  • Community Member Profile Picture
    on at

    Thank you, Klaas,

    Your solution fixed my issue of PO printing too.

    After applying CU3, I find out several functions, which worked fine, have ‘not initialized’ errors and I have no idea on how to fix them. Is there any hotfix available against CU3?

    Thanks,

    Wayne

  • Klaas Deforche Profile Picture
    2,433 on at

    Hi Wayne,

    I opened a case with MS and they have sent me hotfix KB2746697.
    I installed it and the code was indeed fixed, but there were a lot of other fixes in the KB as well.
    The case is still open as I've asked for more information about what is contained in the fix.
    Maybe you should also check it out, it could contain those fixes you want.

    What I did is fix this error in our layer, it's a small and easy fix anyway.
    We don't like to install fixes with lots of fixes and no documentation.

    I'll post an update if I have more info about this fix, but I'm not sure if I will receive it.

  • Community Member Profile Picture
    on at

    Hi Klaas,

    Thanks for the info. I cannot find KB2746697 anywhere. I'll ask Microsoft for it.

    Have a great day!

  • Community Member Profile Picture
    on at

    i would like to ask  to Klaas Deforche where should i replace that code? i have this issue and i couldnt find the KB.

    Thanks in advance!

  • Klaas Deforche Profile Picture
    2,433 on at

    Hi Sebastian,

    Check the following methods:

    PSAPurchaseOrderController.runPrintMgmt()

    PurchPurchaseOrderController.runPrintMgmt()

    and replace:

    if (this.parmArgs().record().TableId == tableNum(PurchTable))

    by:

    if (this.parmArgs().dataset() == tableNum(PurchTable))

    Actually, the method and line where the error occurs is indicated in the stack trace.

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