//the file is unavailable because it is:
return true;
stream.Close();
Jose C Gomez
T: 904.469.1524 mobile
Quis custodiet ipsos custodes?
On Fri, Mar 7, 2014 at 4:50 PM, <livingstonmh@...> wrote:<div> <p></p><p>Well the file we need to check is the actual XML file created by Epicor from the Sales Order Pick List. We have code set up that uses that XML file to build a separate XML file with picking quantities with custom logic. The first step that is performed is a button click that tells SOPick to generate the data. The next Button is print that goes through this generated file. If the user clicks it too soon, then a End of file Expected error pops up, or URL cannot be Null Error. The users requested that the Print Button not even be enabled until the XML is done, but I guess the developer dropped that idea.</p>
This is the code that is in use that reads that XML file:
private void generateHelperXML()
{
Epicor.Mfg.Core.Session epiSession = default(Epicor.Mfg.Core.Session);
epiSession = (Epicor.Mfg.Core.Session)SOPickListForm.Session;
string lastfile = "";
DateTime lastmod = DateTime.MinValue;string files = Directory.GetFiles(@"\\\\server\\EpicorData\\Reports\\" + epiSession.UserID , "SO Pick list*.xml");
if(files.Length>0)
{
for(int i = 0; i<files.Length; i++)
{
if(lastfile == "")
{
lastfile = files[i].ToString();
lastmod = File.GetLastWriteTime(files[i]);}
else
{
if(File.GetLastWriteTime(files[i]) > lastmod)
{
lastfile = files[i].ToString();
lastmod = File.GetLastWriteTime(files[i]);
}
}
}
}</div> <div style="color:#fff;min-height:0;"></div>