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)

check Enum value of RetailStoreTable from RetailStatementTable Form

(0) ShareShare
ReportReport
Posted on by 2,050

i created new column in RetailStoreTable type Enum (acceptnegativevalue) and type of this enum is (NoYes) as you see here in Retail stores

64483.1.JPG

now i want check this value when i press post statement  in open statement form 

17748.2.JPG

so i edit main code of post statement for check if total Difference is negative or positive to this code

void clicked()
{
    if(Sale_M_totalDifferenceStore.realValue()>=0)
    {
    super();
    statementLine_ds.executeQuery();
    element.close();
    }
    else
    {
        info ("in this case can't accept negative value you must change case");
    }
}


so i need to check (acceptnegativevalue) first befor start my previous code

how can i add this into my code?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    Hi!

    If you already have the record of RetailStoreTable just add this:

    if (RetailStoreTable.acceptnegativevalue == NoYes::Yes) - depends of that you need to check

    if you haven't record of RetailStoreTable, you should select the record first of all and then check the value.

  • mohammed.mqi Profile Picture
    2,050 on at

    thanks for replay but i got this error

    (Variable RetailStoreTable has not been declared.)

    so i edited it to this 

    
    
    void clicked()
    {
        RetailStoreTable retailStoreTable;
        
        if (retailStoreTable.acceptnegativevalue == NoYes::No)
        {
            if(Sale_M_totalDifferenceStore.realValue()>=0)
        {
        super();
        statementLine_ds.executeQuery();
        element.close();
        }
        else
        {
            info ("in this case can't accept negative value you must change case");
        }
        
        }
        else
        {
            
        super();
        statementLine_ds.executeQuery();
        element.close();
        }
        
    }

    and error gone is that ok?!

  • Suggested answer
    Rustem Galiamov Profile Picture
    8,072 on at

    No. Next you need to get the record of retailStoreTable.

    RetailStoreTable retailStoreTable;
        
    select retailStoreTable
    where ...

    if (retailStoreTable.acceptnegativevalue == NoYes::No)
  • mohammed.mqi Profile Picture
    2,050 on at

    so is that query will get the current store ?!

  • Verified answer
    Rustem Galiamov Profile Picture
    8,072 on at

    If you put your current store value to where statement - yes.

    RetailStoreTable retailStoreTable;
        
    select retailStoreTable
    where retailStoreTable.StoreNumber == yourStoreId;

    if (retailStoreTable.acceptnegativevalue == NoYes::No)

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 24

#2
Michel ROY Profile Picture

Michel ROY 14

#3
Jagadabi Profile Picture

Jagadabi 6

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans