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
Temporary table thing worked like charm. Just reading data from Aggregate entity and filling values in the table based on the condition.
As it's being used at multiple places, i don't want to touch the aggregate entity. Instead, I will use temporary table as a datasource in the form and i will fill the temp table by looping through the query results. while looping through this output, i can put my condition of whatever amount is greater, use it as the value of temporary table's field. I will bind this temp table to Grid.
Hi Vikky,
As Nikolaos metioned, please try adding a Computed column to data entity.
docs.microsoft.com/.../data-entity-computed-columns-virtual-fields
So, could you add the needed field in the Aggregate entity?
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.
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.
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.
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?
You could set the Query property of the view to create view based on query in D365FO.
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.
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 Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 2,333
André Arnaud de Cal... 846 Super User 2025 Season 2
Sohaib Cheema 681 User Group Leader