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

Announcements

News and Announcements icon
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,286 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,286 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,286 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,430 on at

    Hi Khurshid,

    Please go through below link.

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

  • Mea_ Profile Picture
    60,286 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 10

#2
Harisgillani Profile Picture

Harisgillani 4

#2
dserp Profile Picture

dserp 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans