Hi,
We have developed code to count number of lines for specific values. e.g. Number of protocols having value 'Protocol1'.
Select count(protocol) from X where X.protocol == 'Protocol1'.
This works in AX 2012 is fine but it is giving error that Protocol should be numeric value in AX 7.
Any function is changes in AX 7 for same? Or is there any other method to count same?
Regards,
Smit
*This post is locked for comments
AX 2012 and prior versions were not so strong typed, so you could play with types and use Implicit conversions. Now it is changed to align with C# and other CIL languages and you need to use explicit conversions like int2str() and so on.
Thanks ievgen.
We thought that alternative way but not sure that it will work. It is working fine. Thanks a lot! But I do not understand same was working for string in Ax 2012.
Regards,
Smit
Hi Smit Patel,
Try
Select count(RecId) from X where X.protocol == 'Protocol1'.
Number of records is int value and recId is int as well, so you will get count of records into recId field. In your code you are putting int into string, that's why you get this message.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156