Hello everyone,
I am a very new developer in Dynamic AX and only know some basics. I was creating a new ListPage form which is assigned a query and i just want to simply show some records of InventTransferTable. I created a new interaction class for form. I didn't override any method in class as i want to just display some records. As i click on open the form i get the following error. What should i do? Please help.
Error executing code: QueryBuildDataSource object not initialized.
*This post is locked for comments
For Sohaib:
1. I tried to add a custom filter in code of InventTransferOrders but i was unable to find the exact method where i have to put the code. Can you help me to find the exact line or method of code where i can apply my filter in InventTransferOrders. (This is the same warehouse filter which i am applying in above screenshot.)
2. Thanks Sohaib your suggested findRange method solved the issue for now, i will try to investigate this issue in future.
For Dominic:
I get following error when i try to debug anything.
Have you try using the debugger to see why the init method is called twice?
InventTransferOrders is primarily used for Transfer Orders. There is no ListPage for Transfer Order. Instead, a non-ListPage form is available at below locations to handle transfer orders
Inventory Management >> Periodic >> Transfer Orders
Technically form is located at below location
AOT\Forms\InventTransferOrders (it is a non-ListPage Form)
For your 2nd question, we need to have more details such as how many times InventTransferOrderTable is being used in your query. Query allows us to use same table for more than one time, in situations where we keep name of DataSource different, but actually name of table is same behind the scene. You can check this by looking at properties of each DataSource inside your query. Any Source code can also be responsible for this. Your code is always forcing addRange. Instead you can also make use of findRange. If range found, you can simple assign a value else you can proceed to addRange.
Thank you Sohaib and Dominic. Sorry guys that was my mistake. I had written code in init method of query which was applying dynamic filters to a table and it was not in data source of query.
Experts i have following 2 more questions for you:
1) Is there any built-in ListPage form available for InventTransferOrder table as we have SalesLineBackOrderListPage for SalesLine table, so that i don't have to put extra effort of creating form.
2) Whatever i write in init method of query, the code is called for two times. For example my dynamic filter appears twice.
Hi Zahid,
Go to the query "SalesLineBackOrderListPageTransfer" then Method node. Is the init method there? Any code written in it?
I repeated steps, as per you claim. But I wasn’t able to produce issue.
Created a Table.
Created a query; Dynamic Fields True
Created a list page with Form Template
Dragged my query to List Page.
Created an Interaction Class; No methods added to it.
Specified Interaction Class name into the properties of my ListPage form.
Unable to produce issue. Here below image for your reference.
Now, in general, your error message is saying that for an element QueryBuildDataSource you are trying to use it without initialization of object.
QueryBuildDataSource is a system class. Whenever using a class, it is must to initialize its object. without construction of object we cannot call its methods. That's what error message is complaining about.
If you can provide us some information to reproduce issue, we can help you further.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156