Canada
pawan.deep55@gmail.com

Convert string into enum str2enum in x++

str2enum SalesStatus

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

  1. Name – enum element name
  2. Label – it is used as a string for enum conversion
Str2enum

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.


Author: Pawan Deep SinghI am a D365 Finance & Operations Technical Consultant. I have dedicated this blog to write about all D365FO , ax2012 x++ related tips and tricks I came across in my career. For any query feel free to contact me via the contact section.

 

No Comments

Add your comment