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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

TMP table is regular for SalesinvoiceTmp : remove data

(5) ShareShare
ReportReport
Posted on by 134
Hi,
 
For the sales invoice report I see that the below tables are regular however they are named as Tmp tables.
I see that we have the created transaction id also enabled for these tables .
I want to understand when the data in these tables is getting deleted. Is there a batch job in place as well to delete these records or we need to write custom code to delete it.
 
  1. SalesInvoiceTmp
  2. SalesInvoiceHeaderFooterTmp
 
Thanks,
VK
 
Categories:
I have the same question (1)
  • Suggested answer
    Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at
    The reason for this design is pre-processing. Normally the data is generated when a report runs, but if it takes too long, the report may fail because of a timeout. Pre-precessing means that the data is generated (and stored in tables) and only then the report gets called. Now there is a pre-processing class that can use TempDB tables, but only regular tables were supported when this report was developed.
     
    You can utilize SalesInvoiceTempDataCleanup class to remove old data there. It doesn't seem to be available in any menu, but it's implemented as a rule (called Sales invoice report clean up for temporary data) in Optimization advisor.
  • VM-02050213-0 Profile Picture
    134 on at
    Thanks Martin , 
    The record in salesinvoiceheaderfootertmp is getting deleted when the report from the screen is closed and i assume there is a std method which might be doing this , I want to control that method as we wont to use the data in tmp table for some duration and then only allow it to delete.
    Ideally this is not the right place to check for data , but the scenario is bit complicated.
     
    Thanks,
    VK
  • Suggested answer
    Martin Dráb Profile Picture
    237,803 Most Valuable Professional on at
    Your statement that "the record is getting deleted when the report from the screen is closed" can't be completely true, because the report doesn't have to be shown on screen at all. Also, the RDP class contains logic for reusing existing data - if you look into SalesInvoiceDPBase.processReport(), you'll see it generates the data only if useExistingReportData() returns false. This suggests that the data is persisted in some cases.
     
    If you look into SrsReportRunService.postRunReport(), you'll see that cleanUpRdpPreProcessTables() is called in cases of non-interactive printing, and a comment saying that "For interactive printing, the pre-processed data will be cleaned up with viewer form".
     
    Indeed, SrsReportViewerForm.close() contains a call off cleanUpRdpPreProcessTables(). Nevertheless there is no guarantee that close() will be called at all; the session may terminate without it.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans