Notifications
Announcements
No record found.
Hi All,
This could be silly but i somehow can't get it done.
I have an AOT query as a datasource of the form. It has 2 columns amount1 and amount2.
Form has a Grid and i want to show only 1 amount that is greater between amount1 and amount2 in a single column.
How do i do it? Can we write a display method for an AOT Query ? Thanks in advance.
Regards,
Vikky
You can write the display method in the form data source.
https://docs.microsoft.com/en-us/dynamicsax-2012/developer/using-the-display-method-modifier#to-create-a-display-method
Please note that my formdatasource is an AOT Query and not a Table. It doesn't allow me to add any method on the Query. Any dynamics standard form with such functionality having a display method on formdatasource (AOT Query) ?
Hi Vikky,
Why you have to use a query as a formdatasouece?
Queries are mainly used for reporting purpose...the main adavantage of query is filteration. Could you use a view as a datasource, then you could create a Computed column.
docs.microsoft.com/.../walkthrough-add-a-computed-column-to-a-view
Ah, you are right.
Not sure if you can do it with queries. But you could use a view as your query data source (or directly as form data source) and add a computed column in the view.
Of course depends on your query.
Thanks Will and Niklaos.
I have already explored that option of using View. First of all, i can not add Query as a datasource into the View in D365FO.
Secondly, I have to use Query as it is being used at multiple places. Also, Query is using Aggregate Data Entity as its datasource. D365FO doesn't allow to create a View using that Aggregate data entity as a datasource.
You could set the Query property of the view to create view based on query in D365FO.
Hi,
you are right, Query can't be used as a view data source. Queries are x++ objects, but views are SQL Server objects. And SQL Server can't use x++ objects as it's data source.
But you can use a view as a query data source.
Anyway, could you perhaps add this required field directly in the aggregate data entity?
Will Wu nice, I was not aware of that you could use a query as a data source for a view. I assume there must be some limitations. But, quite cool.
Thanks Will.
I was trying to add a datasource in the view and datasource always needs to be Table. But at View level, i can set its Query property. I will implement this and let you know how it goes.
The problem is the aggregate entity. D365FO doesn't allow Aggregate entity to be part of View, not even if you add Query as a datasource in the view.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 646 Most Valuable Professional
André Arnaud de Cal... 529 Super User 2025 Season 2
Sohaib Cheema 285 User Group Leader