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)

Temp filename from printerjobsettings

(0) ShareShare
ReportReport
Posted on by

Hi

I will try to describe a strange issue that I have come across.

We are creating pdf files, both on server and on client. We let the printerjobsettings give us a file name, that is created somehow in the kernel. This file name is normally called something like:

(..)\AppData\Local\Temp\AXT1435.tmp

We copy this file to the mail attachments folder on the server, change the extension to ".pdf" and remove the original temp file. If we create another file, Ax normally creates a new temp file with a totally different filename, e.g "AXT7355.tmp"

Our problem now, is that some of our customers do not get temp file names like this. Instead, they get file names like "AXT1.tmp" or "Axt53.tmp". The worst thing is, that a new temp file often (or always) gets the same name as the last one. Probably since the last one has been deleted. This seems to be an issue on the server side, not on the client side. Client temp files always get a new totally different name, even if the last file has been deleted.

Does anyone know how this filename gets created? Is there some kind of parameter or system variable that I can change, so that all temp files get random names and definitely not names consisting of only one single digit after the AXT prefix.

I have tried to set break points in all methods that are creating temp file names on client or server, but it seems like the printerjobsettings class does not use these methods.

Thanks in advance for your input.

/Jonas

 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Found the reason/solution. I found out that the temp file counter is reset every time a user logs in. Since we delete all temp files, and our customer uses terminal server that only runs the Ax client (= no other application creates temp files) every time the user logs in the first temp file will be called AXT1.tmp.

    A number of bad error descriptions led me in the wrong direction to begin with...

    So, now we add some random numbers to the file name before copying it to the mail attachment folder.

  • Prasan Kumar Profile Picture
    309 on at

    Hi Jonas,

    I found the same requirment am working on but, different issue.

    I am struggling to attach the file while the code is executing on server to send through the mail.

    I can run the report and attach the same on client and this is successfull. But It is not able in Server side. Could you please send me the code for executing on server which attaches the Morphx report to email.

    Thanks in Advance

    Prasan

    (kvprasankumar@gmail.com)

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
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans