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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AOT Query and View for store Name

(0) ShareShare
ReportReport
Posted on by 439

Hi All,

I have a lookup which is coming from EDT  and I want to filter That   value in the lookup.

I have added a stringEDIT  field  and added a EDT as RetailStoreId

I want to filter the data based on the enum value 

I have override the lookup method  and wrote this code:

lookup.txt

Any Idea can we filter the value of EDT some how???

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    You can use addRange() method to add a filter to your query. Like this:

    qbds.addRange(fieldNum(SON_RetailNotOpen, MyField)).value(queryValue(MyEnum::MyEnumValue));

  • rohit1900 Profile Picture
    439 on at

    Hi Martin thanks for the reply, I believe my Question heading and question description was misleading. I was able to apply range on the query  but thre is a problem I was not able to bring the store name in the Query.

  • rohit1900 Profile Picture
    439 on at

    Here  I have created a query to get the storeName5076.Query1.png

    and then I have created a view from the  query  in order to fetch the StoreName but it is giving the error

    3240.view.png

  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    Yes, your question "Any Idea can we filter the value of EDT some how?" was indeed misleading, if your actual problem is something else.

    The compilation error says: "For views relation fields in query can not come from base or derived tables". I see your relation is between OMOperatingUnitID field and DirPartyTable - shouldn't you use OMOperatingUnit table instead of DirPartyTable?

  • rohit1900 Profile Picture
    439 on at

    I tried with that also  it gave the same error and then I switch to dirpartyTable .

  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    Both cases compile correctly in my AX7 environment (I don't have any AX2012 on hand).

    Don't you have any additional datasources in your view?

    Can you show us a screenshot with properties of your relation?

  • rohit1900 Profile Picture
    439 on at

    5074.relation.png

    above mentioned screenshot

  • rohit1900 Profile Picture
    439 on at

    2425.lookup.txt

    Issue is resolved I have used sysTableLookup.addLookupMethod(tableMethodStr(RAXRetailStoreStatusTable, storeName));

    Thank you for the help.

  • Martin Dráb Profile Picture
    237,976 Most Valuable Professional on at

    I think you again forgot to tell you a few things. A lookup method surely couldn't fix the compilation error in your view, so I guess you gave up the view and solve the business requirement (which you never explained to us, so we couldn't help with it) in a different way. Am I right?

    It would help if you start by explaining your actual requirement, instead of just showing a piece of code of your various attempts to solve it.

  • rohit1900 Profile Picture
    439 on at

    Yes the error in the view and the new query  are no way related and due to time constraint i gave up the view approach   and  still wondering what could have done to make view works as it was throwing the error message in the screenshot.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans