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.
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
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:
Now, if I run it in my current company (DAT), I get a 0, which is expected:
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 1,120
Sohaib Cheema 815 User Group Leader
André Arnaud de Cal... 811 Super User 2025 Season 2