web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AIF : issue when Change Enum value through c#

(0) ShareShare
ReportReport
Posted on by 576

Hello..

I added new enum has 5 values to SalesTable , and i already use salesSalesOrderServices to upload sales order to ax 2012R3 everything is ok the only issue is when change the enum value through the c# application , the enum in SalesTable is take the first value .

                switch (HeaderSalesMan.SectorID)
                {
                    case "1": st.Activites = AxdEnum_Activites.Icecream;       
                        break;
                    case "2": st.Activites = AxdEnum_Activites.Chipsy;
                        break;
                    case "3": st.Activites = AxdEnum_Activites.Sweets;
                        break;
                    default :st.Activites = AxdEnum_Activites.Stoped;
                        break;
                }

is there any condition to insert the enum value that different than insert string.
I already inserted alot of new string value , but it's first time to insert Enum value.

thank you.


*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Sheikh Sohail Profile Picture
    6,125 on at

    Have you debug the code? what you are receiving from C#, I believe from C# you are sending 1st value every time.

  • Ismail Mohamed Profile Picture
    576 on at

    I displayed the value in message Box, and it displays the correct value,

    Also debug the switch and it go the right case

  • Suggested answer
    Sheikh Sohail Profile Picture
    6,125 on at

    have you found where value is going to change?  you can override the validatewrite method and debug it also

  • Suggested answer
    udaY-ch Profile Picture
    5,175 on at

    Hi Mohammed,

    Have you tried inserting using enum values perhaps strings. Like st.Activites = 1 or st.Activites = 2.

    /Uday.

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 4 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans