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 :
Dynamics 365 Community / Blogs / Simple AX / Check attachment delete fro...

Check attachment delete from filesystem

Daniele Ferraretto Profile Picture Daniele Ferraretto

Hi, could happen (I hope in your case not) that some attachment of Dynamics Ax was deleted from folder from external program.

This little utility check your reference in AX and search in the folder for missing file

static void findAttachmentDeleted(Args _args)
{
docuref dr;
docutype dt;
str 200 _filepath,filename,impfile;
real filehandle;

select dr where dr.RefTableId == tablenum(inventtable);

while(dr.RecId)
{
dt = docutype::find(dr.TypeId);
if(dt.ArchivePath != “”)
{
[fileHandle, fileName] = WinApi::findFirstFile(dt.ArchivePath + “\\” + dr.docuValue().fileName());
if(!fileName)
{
warning(“check on FILESYSTEM the file ” + dt.ArchivePath + “\\” + dr.docuValue().fileName());
}
}
next dr;
}
}



This was originally posted here.

Comments

*This post is locked for comments