Convert string into enum str2enum in x++
This post will explain how you can assign and convert string input either read from excel etc into enum type variable. For this example, we’ll be going to use SalesStatus Enum used in Sales order to define its current state. Enum has 2 key properties
- Name – enum element name
- Label – it is used as a string for enum conversion
Public static anytype str2enum(anytype type, str text)
I hope this article helped you learn how to use str2enum (x++) in the D365 Finance & operations AX. Don’t forget to share this article.
You may also want to see our article on How to handle 401 unauthorised error in x++. You can find us on facebook.
No Comments