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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

typeId() replacement in AX 2012

(0) ShareShare
ReportReport
Posted on by 231

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

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    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);

  • martinarul Profile Picture
    231 on at

    Hi Vilmos,

       Thank you..

    I got the code myself.

    The code is:

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

    Thank you..

  • Martin Dráb Profile Picture
    239,274 Most Valuable Professional on at

    It's overcomplicated. Simply use 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 4 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans