Search code examples
dynamics-navtext-manipulation

Text comparison in Dynamics Nav "C/AL"


I would like to know if a text ends in '0000' in C/AL code, but I am not sure if I am doing something wrong or the documetned functions simply are not prensent in the version of NAV I am using (NAV 2016). String Functions in NAV In any case I would like to know how can I do this if it's not with this functions.

Text.ENDSWITH('0000'); // Does not compile, 
//no autocomplete for the ENDSWITH function either

Solution

  • Article you are referring to is about AL - the language for developing extensions for Nav 2018 and Dynamics 365.

    Here is the link you’re looking for https://learn.microsoft.com/en-us/dynamics-nav/text-data-type

    No ENDSWITH analog though. You can use COPYSTR or DELSTR to simulate it.

    Alternatively you can use .Net variable of type System.String to get access to all string functions of C#. C/AL’s text is assignable to .Net’s string.