Hello,
I’m new in Axapta and I’m working with AX 4.0.
I have to show some data in a form and I need an union query.
Is it possible in AX 4.0?
Is there a way to do it?
Thanks a lot.
Hello,
I’m new in Axapta and I’m working with AX 4.0.
I have to show some data in a form and I need an union query.
Is it possible in AX 4.0?
Is there a way to do it?
Thanks a lot.
Support for union queries were added in AX2009, therefore you can’t do it in AX4. You have to find some workaround. If no better way is possible, you can always resort to using a temporary table.
I’m considering just this alternative!
Thanks for your answer.
Hello,
Now I have another problem with the temporary table.
If I open the form from another form (SalesOrder) I can’t see the temporary table data that I put in a grid (the grid is empty).
If I open the same form directly from AOT I can see the data in the grid.
I create the init method in the datasource to populate the table.
Thanks for the help.
The problem is in the init method:
if I comment the line with che command super(); I find the data of the temporary table in the grid
(after the super(); I put TempTable.setTmpData(…)
I don’t know why.
Do someone explain me why?
Thanks a lot.
It’s difficult to say what’s wrong if we don’t know what you have implemented.
One possible explanation is that there is an automatic dynalink between those two forms, therefore your data is filtered out based on the active record in the parent form. In that case, you just need to remove that dynalink, e.g. by calling this code in the datasource’s init():
this.query().dataSourceNo(1).clearDynalinks();
If you run into such an issue, you should always diagnose what data you have in the buffer and what query is used, because one of these two things is wrong and you have to know which one.
That’s fine!!!
I can’t understand why because my example it’s so easy:
I have a form with only one datasource that is on a temporary table (it’s a copy of CustInvoiceJour) and a grid linked to datasource.
The problem there was only if I call the form from another form (SalesTable) with a button.
Now It’s ok and this is my datasource’s init method:
public void init()
{
super();
this.query().dataSourceNo(1).clearDynalinks();
Texa_tmp_CustInvoiceJour.setTmpData(Texa_TempInvoiceJour::populateTmpData());
}
Thank you very much!