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)

Can we join View with temp table?

(0) ShareShare
ReportReport
Posted on by 928

Hi everyone,

I have a lookup form where I want to add range to the the querybuilddatasource. 

this.queryBuildDataSource().addRange(fieldNum(ABCHRMEmployeeLookup,PositionId)).
value(HcmPosition::find(hcmPositionHierarchy.Position).PositionId);

this line is working fine with few Records but with 996 records it give this error.

4645.Capture11.JPG

Then I decided to keep the 996 records in the tempDB table and try to create join with my data source

which is a view of the query.

I wrote this code to join with my current datasource.

0841.123.JPG

Then I got this Error

321.JPG

Please help me how I can solve the first and second problem.

P1: How to set multiple ranges without buffer overflow?

P2: How to Join Temp table with this data source? (datasource is AOT View of AOT query)

For Problem 2 I tried this suggestion. But I can't be able to use  'this. query().'

community.dynamics.com/.../the-data-source-is-not-embedded-within-a-parent-data-source

*This post is locked for comments

I have the same question (0)
  • Verified answer
    feelyd Profile Picture
    260 on at

    Your first issue I have come across before , it relates to to the maximum buffer size set in the database tuning tab of the server configuration utility.

    This buffer is used for binding of input and output parameters for SQL statements.

    You can try setting this to a larger size.

  • Verified answer
    Mea_ Profile Picture
    60,284 on at

    for second error create new variable:

    QueryBuildDataSource qbds = this.queryBuildDatasource().addDatasource()tableNum...)

    qbds.joinMode...

    qbds.addLink...

  • Khurshid Wali Profile Picture
    928 on at

    Thank you Feely and Miroshnikov for your valueable reply,

    Feely I don't have access to Server configuration on my client server.

    Ievgen this method worked for regular table but not working on temp table.

    Any suggestions?

  • Mea_ Profile Picture
    60,284 on at

    Try to use setRecord method as it is shown here www.axaptapedia.com/Temporary_tables

  • Khurshid Wali Profile Picture
    928 on at

    What is the function of setRecord and where to write this code?

    I am little bit confused!

  • Mea_ Profile Picture
    60,284 on at

    It has an example with explanation there, here it is  this.queryRun().setRecord(tmpTableClass::populateTmpData()); where tmpTableClass::populateTmpData() returns temp table

  • Khurshid Wali Profile Picture
    928 on at

    but there is no tmpTableClass in my AX version?

    AX 2012 R3 6.3.3000

  • faiz7049 Profile Picture
    2,382 on at

    Hi Khurshid,

    Please go through below link.

    mafsarkhan.blogspot.com/.../example-for-using-tempdb-table-in-query.html

  • Mea_ Profile Picture
    60,284 on at

    yes, it's just an example, there should be your table, please look at blog post provided by  faiz7049

  • Khurshid Wali Profile Picture
    928 on at

    Using SetRecord is not showing any Result

    qbds=this.querybuilddatasource().addDataSource(tableNum(AbcPositionHierarchy));
    qbds.joinMode(JoinMode::ExistsJoin);
    qbds.addLink(fieldNum(AbcHRMEmployeeLookup,HcmWorker),fieldNum(AbcPositionHierarchy,workerRecId),this.queryBuildDataSource().name());
    this.setRecord(abcPositionHierarchy);

    what is wrong with this code? especially this.setRecord line

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