Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Inserting to Temp table using query

(0) ShareShare
ReportReport
Posted on by

Hi

Craeted an AOT Query using one table and I am trying to insert records from Taxtrans table to my temporory table (TmpTaxTransactionRDP), unable to insert value from taxtrans and only blank records are inserting. Kindly see the follwing my query and classes.


TaxListCutomizedQueryDP

ClassDecleration
[
SRSReportQueryAttribute(queryStr(TaxListQueryAM))
]
public class TaxListCutomizedQueryDP extends SRSReportDataProviderBase //
{
TmpTaxTransactionRDP TmpTaxTransactionRDP;
}

getTmpTaxTransactionRDP
[
SRSReportDataSetAttribute(tableStr("TmpTaxTransactionRDP"))
]
public TmpTaxTransactionRDP getTmpTaxTransactionRDP()
{
select * from TmpTaxTransactionRDP;

return TmpTaxTransactionRDP;
}

processReport

public void processReport()
{
Query Query;
QueryRun QueryRun;
TaxTrans lclTaxTrans;
Query = this.parmQuery();
QueryRun = new QueryRun(Query);
ttsBegin;
while (QueryRun.next())
{

lclTaxTrans= QueryRun.get(tableNum(TaxTrans));
TmpTaxTransactionRDP.TaxAmount=lclTaxTrans.TaxAmount;
TmpTaxTransactionRDP.TaxCode=TaxTrans.TaxCode;
TmpTaxTransactionRDP.TransDate=TaxTrans.TransDate;
TmpTaxTransactionRDP.insert();

}

ttsCommit;

}

taxtrans.JPG

Thanks & Regards

Avinash

*This post is locked for comments

  • RE: Inserting to Temp table using query

    Thanks Crispin,  Its showing  values

  • RE: Inserting to Temp table using query

    I changed Table property from temp to regular and I checked in the SQL, even SQL query also getting the same (blank).

  • RE: Inserting to Temp table using query

    Dear Crispin,

    Dynamic Property is 'NO', and added these fields I already mentioned in my above code. I did with new query and getting same.

  • RE: Inserting to Temp table using query

    Yes Mr. Andre Arnaud,

    I am getting exact number of records but only filling values in RECID, DATAAREAID,PARTITION all others are blank

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 292,516 Super User 2025 Season 1 on at
    RE: Inserting to Temp table using query

    HI Avinash,

    If I do understand your question correctly, you do get records in the table TmpTaxTransactionsRDP, but the fields are not filled. In that case, review the method where you initialize the query (parmQuery). It might use a query with no or the wrong fields selected.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans