Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

One of my table fields with enum is not saving.

(0) ShareShare
ReportReport
Posted on by 46

Requirement: I need to display the status per SO Line – which lines are still on open order, picked, packed or invoiced (we invoice per sales line).

Problem: One of my enum values is not passing – nothing fancy, just as simple assignment from view to temporary table. The enum value does seems to be “NOT being saved into the temp table”. What am I missing here? I hope someone can help.

On my temp table, the column has enum type of XXX_APG_ECOStatus(acquired from SalesLineStatus on an AOT view)

 pastedimage1564233776893v1.png

The enum contains these elements.

pastedimage1564233813455v2.png                                                               

 

 When retrieving the search result, ECOStatus (or Sales Line Status) does not yield.

pastedimage1564233858374v3.png

I checked my temp table, the value is not indeed existing.

 pastedimage1564233878218v4.png

 

I am sure I set my datasource correctly.

 pastedimage1564233900661v5.png

 

  

I went to check by breaking point every affected line; I even made another column and a variable to make sure and see the data. Everything is fine. Both ecoResultTempTable.ECOStatus & ecoResultTempTable.SalesLineStatus are not being used or reassigned new values after these lines.

pastedimage1564233955151v6.png

Nothing is fancy on my code – just a very simple straightforward assignment.

This issue also persists on other elements of the enum – not just “Open Order”.

 

What I already did but was NOT successful:

  • Created a new column in temp table.
  • Created a new column in the source query/view and took the value from there instead.
  • Created and assigned an EDT for the affected enum both for temp table and the query/view.
  • Cleared my usage data.
  • Restarted my computer (to clear local cache)
  • Restarted AX.
  • Re-created this form.
  • Re-created my query.
  • Re-created my view.
  • Praying and contemplating for hours on this. T.T

Full code below.

void clicked(){

    XXXX_APG_ECOView                    ecoView;

    XXXX_APG_ECOTempTable               ecoResultTempTable;

    XXXX_APG_ECOStatusType              ecoStatus; /*temporary for debugging*/

    ;

 

 

    if(XXXX_APG_ECOTempTable::ValidateFroToDates(lsdFrom, lsdTo)){

        ttsBegin;

 

        while select

                   SalesId

                  ,CustAccount

                  ,SalesName

                  ,SoCreatedDate

                  ,SalesStatus

                  ,SalesConfirmStatus

                  ,ShippingDateRequested

                  ,RecId

                  ,CostMatrix

                  ,LCNo

                  ,NCODate

                  ,Expiry1

                  ,Expiry2

                  ,Expiry3

                  ,NCO

                  ,RefNo

                  ,Packaging

                  ,Brand

                  ,CasesPerFCL

                  ,ProductStatus

                  ,LabelStatus

                  ,CartonStatus

                  ,configId

                  ,PaymentTerm

                  ,PaymTermId

                  ,BGColor

                  ,FGColor

                  ,ItemId

                  ,CanSize

                  ,InventDimId

                  ,ItemBOMId

                  ,Media

                  ,NetWeight

                  ,PCW

                  ,DrainedWeight

                  ,SALT

                  ,FLAKES

                  ,OBR

                  ,Tins

                  ,DlvTerm

                  ,LSDLatest

                  ,LSD2

                  ,LSD3

                  ,Destination

                  ,Freight

                  ,ShippingNominations

                  ,PackId

                  ,PackQty

                  ,PackDate

                  ,InvoiceId

                  ,InvoiceDate

                  ,InvoiceQty

                  ,PickQtySum

                  ,PickLatestDate

                  ,SalesOrderRecId

                  ,SalesLineStatus

        from ecoView

        order by LSDLatest asc

        where(

                 ecoView.LSDLatest >= lsdFrom /*declared from classdeclaration*/

              && ecoView.LSDLatest <= lsdTo   /*declared from classdeclaration*/

             ) //end of where clause

        {

 

            /*Sales Header START*/

            ecoResultTempTable.SalesId                = ecoView.SalesId;

            ecoResultTempTable.SORecId                = ecoView.SalesOrderRecId;

            ecoResultTempTable.CustAccount            = ecoView.CustAccount;

            ecoResultTempTable.SalesName              = ecoView.SalesName;

            ecoResultTempTable.SoCreatedDate          = ecoView.SoCreatedDate;

            ecoResultTempTable.SalesStatus            = ecoView.SalesStatus;

            ecoResultTempTable.SalesConfirmStatus     = ecoView.SalesConfirmStatus;

            ecoResultTempTable.ShippingDateRequested  = ecoView.ShippingDateRequested;

            /*Sales Header END*/

 

 

            /*Sales Line START*/

                /*General Setup START*/

                ecoResultTempTable.CostMatrix             = ecoView.CostMatrix;

                ecoResultTempTable.LCNo                   = ecoView.LCNo;

                ecoResultTempTable.NCODate                = ecoView.NCODate;

                ecoResultTempTable.Expiry1                = ecoView.Expiry1;

                ecoResultTempTable.Expiry2                = ecoView.Expiry2;

                ecoResultTempTable.Expiry3                = ecoView.Expiry3;

                ecoResultTempTable.NCO                    = ecoView.NCO;

                ecoResultTempTable.RefNo                  = ecoView.RefNo;

                ecoResultTempTable.Packaging              = ecoView.Packaging;

                ecoResultTempTable.Brand                  = ecoView.Brand;

                ecoResultTempTable.SalesQty               = ecoView.CasesPerFCL;

                ecoResultTempTable.ProductStatus          = ecoView.ProductStatus;

                ecoResultTempTable.LabelStatus            = ecoView.LabelStatus;

                ecoResultTempTable.CartonStatus           = ecoView.CartonStatus;

                ecoResultTempTable.Buyer                  = ecoView.configId;

                ecoResultTempTable.PaymentTermName        = ecoView.PaymentTerm;

                ecoResultTempTable.PaymTermId             = ecoView.PaymTermId;

                ecoResultTempTable.BGColor                = ecoView.BGColor;

                ecoResultTempTable.FGColor                = ecoView.FGColor;

                ecoStatus                                 = ecoView.SalesLineStatus;

                ecoResultTempTable.ECOStatus              = ecoStatus;

                ecoResultTempTable.SalesLineStatus        = ecoStatus;

                /*General Setup END*/

 

                /*Buyer specs START*/

                ecoResultTempTable.ItemId                 = ecoView.ItemId;

                ecoResultTempTable.CanSize                = ecoView.CanSize;

                ecoResultTempTable.InventDimId            = ecoView.InventDimId;

                ecoResultTempTable.BOMId                  = ecoView.ItemBOMId;

                ecoResultTempTable.Media                  = ecoView.Media;

                ecoResultTempTable.NetWeight              = ecoView.NetWeight;

                ecoResultTempTable.PCW                    = ecoView.PCW;

                ecoResultTempTable.DrainedWeight          = ecoView.DrainedWeight;

                ecoResultTempTable.Salt                   = ecoView.SALT;

                ecoResultTempTable.Flakes                 = ecoView.FLAKES;

                ecoResultTempTable.OBR                    = ecoView.OBR;

                ecoResultTempTable.Tins                   = ecoView.Tins;

                /*Buyer specs END*/

 

                /*Pick START*/

                //TO-DO

                /*Pick END*/

 

                /*Ship START*/

                ecoResultTempTable.DlvTerm                = ecoView.DlvTerm;

                ecoResultTempTable.LSDLatest              = ecoView.LSDLatest;

                ecoResultTempTable.LSD2                   = ecoView.LSD2;

                ecoResultTempTable.LSD3                   = ecoView.LSD3;

                ecoResultTempTable.Destination            = ecoView.Destination;

                ecoResultTempTable.Freight                = ecoView.Freight;

                ecoResultTempTable.ShippingNominations    = ecoView.ShippingNominations;

                /*Ship END*/

 

                /*Invoice START*/

                //TO-DO

                /*Invoice END*/

            /*Sales Line END*/

 

            ecoResultTempTable.insert();

        }

        ttsCommit;

 

        XXXX_APG_ECOTempTable_1_ds.research();

    }//if statement end

}//click method end

*This post is locked for comments

  • Verified answer
    Kashiru Kito Profile Picture
    46 on at
    RE: One of my table fields with enum is not saving.

    Hi André, as promised. I was able to resolve this issue by recreating my destination table.

  • Kashiru Kito Profile Picture
    46 on at
    RE: One of my table fields with enum is not saving.

    Hi André,

    Thanks for stopping by.

    - Does the view actually provide the correct value in the table browser?

    >>>Yes, the view provides the correct value (as seen on the breakpoint) including the values across other columns. Just this single column that I am having trouble with.

    - After the x++ compilation, also perform a full CIL build and eventually also a restart of the AOS (after the CIL build).

    >>>>This will be my last resort as this means a downtime.

    I'll try to re-create my destination table and revert back.

  • André Arnaud de Calavon Profile Picture
    294,903 Super User 2025 Season 1 on at
    RE: One of my table fields with enum is not saving.

    Hi Kashiru,

    There are two things you can check here:

    - Does the view actually provide the correct value in the table browser?

    - After the x++ compilation, also perform a full CIL build and eventually also a restart of the AOS (after the CIL build).

  • Kashiru Kito Profile Picture
    46 on at
    RE: One of my table fields with enum is not saving.

    I also synchronized and recompiled and still no luck.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 48

#3
Zain Mehmood Profile Picture

Zain Mehmood 6 Moderator

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans