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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

How to convert str2int64 in ax 2012.

(0) ShareShare
ReportReport
Posted on by 630

Hi friends,

I am using below code for changing string value to Int64.

    str          curCompany;    
    Int64 	 myInt64;

    curCompany  = curext();

    myInt64 = str2int64(curCompany);

    info(strFmt('%1',myInt64));

But in info i am not getting any value.

Please let me know how to convert str2int64 in ax 2012.

Thanks & Regards

Rahul.

I have the same question (0)
  • Suggested answer
    ergun sahin Profile Picture
    8,816 Moderator on at
    RE: How to convert str2int64 in ax 2012.

    str         curCompany;    
    Int64 	    myInt64;
    
    curCompany  = "123";//curext();
    myInt64 = str2int64(curCompany);
    info(strFmt('%1',myInt64));// 123 //real purpose of str2int methods
    
    curCompany  = "ABC";//curext();
    myInt64 = str2int64(curCompany);
    info(strFmt('%1',myInt64));// 0

  • Suggested answer
    greengrimms Profile Picture
    1,400 on at
    RE: How to convert str2int64 in ax 2012.

    Hi Rahul,

    What value are you getting from curext() function? Maybe it contains a character that might not be able to convert to integer. I tried converting a string to int64 and printing it and I'm seeing a value, since strFmt converts your value back to string:

    pastedimage1625584677461v2.png

    Now, if I run it in my current company (DAT), I get a 0, which is expected:

    pastedimage1625584550082v1.png

    Also, if I may advice, it's not a good practice to run this types of conversions if you're not 100% sure on the input you're going to get.

    Hope it helps.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,120

#2
Sohaib Cheema Profile Picture

Sohaib Cheema 815 User Group Leader

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans