How to get the creation date of a PDF file in Microsoft Dynamics AX 2009 with X++?
And how to open that PDF file in the button click?
How to get the creation date of a PDF file in Microsoft Dynamics AX 2009 with X++?
And how to open that PDF file in the button click?
There is no build in function to do that, but you could ask Windows.
The WinAPi getFileTime function returns a filetime structure. However both the parameters and the return value is a little difficult to interface to (look at other function in the AX WinAPI class).
Much easier is the interface to the .Net getCreationTime method (do be defined in WinAPI):
client static UTCDateTime getFileCreationTime(str name)
{
return CLRSystemDateTime2UtcDateTime(System.IO.File::GetCreationTime(name));
}
To be used like:
static void Job1(Args _args)
{;
info(strFmt("%1", WinAPi::getFileCreationTime(@"C:\Users\zjbk\My Documents\ActionTool_SysFlushDictionaryServer.xpo")));
}
To open a PDF or whatever file using the default viewer:
WinAPI::ShellExecute(@"C:\test.pdf");
© 2022 - 2024 — McMap. All rights reserved.