Hi,
I'm hitting an issue in AX 2012 CU3 in the email distribution batch job. When sending multiple emails with the same named attachment only the first email will send and the rest will fail. After some debugging I've found this the issue is in SysEmailDistributor.processemails() where the WinAPIserver::deletefile() fails to actually delete the attachment out of the temp directory. It doesn't actually throw an error at this point but when it loops around the second time to the bindata.savefile() and tries to rewrite the same names file to this directory it jumps out to the exception catching and fails the email. Strangely, when the batch job has finished processing the file then disappears (sometime after exiting the BatchRun::servergetNextTask() method).
Before both the save and delete command are the same permission assertions:
fileIOPermission = new FileIOPermission(filePathName,'w');
fileIOPermission.assert();
The permissions on the temp folder give full permission to the account under which the AX service is running.
I wouldn't expect it to be a coding error since its all unaltered foundation layer code.
Can anyone offer any insights as to what may be going on? Why would the save work fine but the delete not work? Are API delete calls somehow subject to ttsbegin / commit calls?
Any thoughts are apprecitated.
Cheers
David
*This post is locked for comments
I have the same question (0)