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

Announcements

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,670 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dekion Profile Picture

dekion 4

#2
Virginia99 Profile Picture

Virginia99 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans