web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Error executing code: QueryBuildDataSource object not initialized.

(0) ShareShare
ReportReport
Posted on by

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.

2016_2D00_04_2D00_14_5F00_13_2D00_03_2D00_55.png

*This post is locked for comments

I have the same question (0)
  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    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.

      SampleListPage.png

       

       

      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.

       

  • dolee Profile Picture
    11,279 on at

    Hi Zahid,

    Go to the query "SalesLineBackOrderListPageTransfer" then Method node. Is the init method there? Any code written in it?

  • Community Member Profile Picture
    on at

    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.

    2016_2D00_04_2D00_14_5F00_15_2D00_08_2D00_21.png

    2016_2D00_04_2D00_14_5F00_15_2D00_08_2D00_21.png

  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

     

    1. 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)

       

    2. 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.

  • dolee Profile Picture
    11,279 on at

    Have you try using the debugger to see why the init method is called twice?

  • Community Member Profile Picture
    on at

    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.

    2016_2D00_04_2D00_19_5F00_15_2D00_51_2D00_33.png

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans