Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

typeId() replacement in AX 2012

Posted on by 217

Dear Friends,

How to write the following Ax 2009 code in ax 2012?

Set  set = new Set(typeId2Type(typeid(recId)));

If I write the same as follows, when I compile it does not throw any error but throws the error at run time.

Set  set= new Set(typeId2Type(extendedTypeNum(RecId)));

the error thrown is:

Function Global::typeId2ExtendedTypeId must be called with an extended data type.

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Ax 2009 to Ax 2012

    It's overcomplicated. Simply use Set set = new Set(Types::Int64).

  • martinarul Profile Picture
    martinarul 217 on at
    RE: Ax 2009 to Ax 2012

    Hi Vilmos,

       Thank you..

    I got the code myself.

    The code is:

    Set  set= new Set(extendedTypeId2Type(extendedTypeNum(RecId)));

    Thank you..

  • Suggested answer
    Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: Ax 2009 to Ax 2012

    The new Set() is expecting the input parameter of Types enum.

    msdn.microsoft.com/.../set.new.aspx

    You can use the primitive data type of your Extended Data Type, which is int64 for recId.

    msdn.microsoft.com/.../recid.aspx

    So you would do it like Set set = new Set(Types::Int64);

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans