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 :
Finance | Project Operations, Human Resources, ...
Answered

Is it possible to get the the data type of the method that is returning?

(0) ShareShare
ReportReport
Posted on by

Hello Every One,

Is it possible to get the the data type of  the method that is returning? Like I have a table method that is returning boolean using x++ how do i get it ? Even if their return type is an edt also would like to get the data type of it as well?

Same like for table fields we are are able to get it using dictfield.baseType().

Is there any way that I can get it?

Thanks,

Phani  

I have the same question (0)
  • Suggested answer
    Hossein.K Profile Picture
    6,648 on at

    Hi Phani,

    I propose you write a method to check this. in this method you can use some system's method like isInteger(input_int) to check it.

  • Suggested answer
    Hossein.K Profile Picture
    6,648 on at
    Informational functions isbool(X) Returns TRUE if the field value is Boolean.
    isint(X) Returns TRUE if the field value is an integer.
    isnotnull(X) Returns TRUE if the field value is not NULL.
    isnull(X) Returns TRUE if the field value is NULL.
    isnum(X) Returns TRUE if the field value is a number.
    isstr(X) Returns TRUE if the field value is a string.
    typeof(X) Returns a string that indicates the field type, such as Number, String, Boolean, and so forth
  • Community Member Profile Picture
    on at

    Hi Hossein Karimi ,

    Thanks for your reply.

    I am not talking about the value that the method return. when we look at the method code we understand the return type of it. I just want to write some x++ code to pull it. is it possible?

    Thanks,

    Phani

  • Suggested answer
    Hossein.K Profile Picture
    6,648 on at

    Hi,

    I said you can develop a method and in this method write a switch case and check all state with the method which I sent you.

  • Community Member Profile Picture
    on at

    Hi Hossein Karimi,

    It seems my question itself not clear to you.

    Eg1:  

    public boolean valid()

    {

    // some code here

    }

    eg 2:

    public Amount Price()

    {

    // some code here

    }

    from the eg1 I have to take boolean. and in eg 2 Amount is Extended data type in turn which gives Real data types .

    I want to get thoes two data types and show in info log.

    Thanks,

    Phani

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    You've already got answers in your previous thread, "Is it possible to get the method return type in Ax2012?" (community.dynamics.com/.../is-it-possible-to-get-the-method-return-type-in-ax2012). Please read them. If you have a follow-up question, ask it there, rather then creating a duplicate thread about the same thing and starting the whole discussion from the very beginning, as if you never read any answers.

  • Community Member Profile Picture
    on at

    Hi Martin,

    In the above thread there is no code to find the Extended data type type. I am which type that is extended in edt. So instead of asking in the previous thread I created new one.

    Thanks,

    Phani

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    There is code to find the return EDT - I told you which method to use (SysDictMethod.returnId()) and Ergün then gave you sample code.

    If you have a problem with it, please explain the problem in the original thread.

    If you just ask the same question, all we could do is giving you the same answer.

    Note that I don't understand the sentence "I am which type that is extended in edt". If it was going to say something important, please rephrase it.

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    There is code to find the return EDT - I told you which method to use (SysDictMethod.returnId()) and Ergün then gave you sample code.

    If you have a problem with it, please explain the problem in the original thread.

    If you just ask the same question, all we could do is giving you the same answer.

    Note that I don't understand the sentence "I am which type that is extended in edt". If it was going to say something important, please rephrase it.

  • Martin Dráb Profile Picture
    237,878 Most Valuable Professional on at

    There is code to find the return EDT - I told you which method to use (SysDictMethod.returnId()) and Ergün then gave you sample code.

    If you have a problem with it, please explain the problem in the original thread.

    If you just ask the same question, all we could do is giving you the same answer.

    Note that I don't understand the sentence "I am which type that is extended in edt". If it was going to say something important, please rephrase it.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans