Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

AOT Query and View for store Name

Posted on by 425

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

  • rohit1900 Profile Picture
    rohit1900 425 on at
    RE: AOT Query and View for store Name

    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.

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: AOT Query and View for store Name

    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
    rohit1900 425 on at
    RE: AOT Query and View for store Name

    2425.lookup.txt

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

    Thank you for the help.

  • rohit1900 Profile Picture
    rohit1900 425 on at
    RE: AOT Query and View for store Name

    5074.relation.png

    above mentioned screenshot

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: AOT Query and View for store Name

    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
    rohit1900 425 on at
    RE: AOT Query and View for store Name

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

  • Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: AOT Query and View for store Name

    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
    rohit1900 425 on at
    RE: AOT Query and View for store Name

    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

  • rohit1900 Profile Picture
    rohit1900 425 on at
    RE: AOT Query and View for store Name

    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.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,149 Most Valuable Professional on at
    RE: AOT Query and View for store Name

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

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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans