Good morning, classmates.
I have this code to save a field to a .txt file in Epicor9, but I need to pass it to Epicor10, someone who can help me ?? I would appreciate it
for each ttOrderHed no-lock where ttOrderHed.Company = 'HERMTY' and ttOrderHed.OrderNum > 0.
for each OrderHed no-lock where ttOrderHed.Company = OrderHed.Company and ttOrderHed.OrderNum = OrderHed.OrderNum .
output to 'F:\Epicor Software\EpicorData\CorreoRechazo.txt' APPEND.
PUT ttOrderHed.OrderNum skip.
OUTPUT CLOSE.
end .
end.
I don’t think it will make much of a difference, in this case, but I would use something that will perform better due to not opening and closing the file each time through the loop.
using (var file = new System.IO.StreamWriter(@"F:\Epicor Software\EpicorData\CorreoRechazo.txt", true))
{
foreach(var x in ttOrderHed.Where(oh=>oh.Company=="HERMTY" && oh.OrderNum > 0))
{
file.WriteLine(x.OrderNum);
}
}