Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Where condition is not working in select statement - AX 2012

(0) ShareShare
ReportReport
Posted on by

Hi All,

We are trying to get the email address from LogisticsElectronicAddress table, below is the statement we have written:

Select * from LogisticsElectronicAddress  - It is getting the first record as per standards, but if we add the "Where" Clause in the statement the records is not fetching and the buffer is empty even there is a record in the table.

select * from logisticsElectronicAddress where logisticsElectronicAddress.PrivateForParty = ****** - result is empty here , even there is a record in the table.

We have written this in one of the class to get the email address of the worker. We have tried with connecting DirPerson,DirPartyTable and HcmWorker table.

Please advise me how can we resolve this issue.

Regards,

Akbar

*This post is locked for comments

  • Suggested answer
    Satish Panwar Profile Picture
    Satish Panwar 14,649 on at
    RE: Where condition is not working in select statement - AX 2012

    Hi Akbar,

    When you do first select, it's just picking up all records but give you first record if you try to use the table and try to assign it to a variable.

    What i suggest is that you find what's the value for private for party in first statement and then use that in next statement.

    Thanks,

    Satish Panwar

    Please help verify answer(s) if they guide you in right direction so other community members can also benefit from your question with verified answer.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Where condition is not working in select statement - AX 2012

    I find it very hard to believe that the where condition would not be working. I'm sure that the explanation is somewhere else.

    Could you perhaps share your actual select statement just like you wrote it in your code? And a screenshot of your table browse / database where we see if there is a record matching to that criteria?

    Also, you wrote that "Select * from LogisticsElectronicAddress" is returning the first record. It should return all records from the table (for the current company).

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans