I have created an updatable BAQ using the Advanced BPM update option and configuration. I have some code in the post-processing GetList directive that sets the Earliest Apply Date to today. This works fine when I run it within the BAQ designer. If I try to run it in the BAQ Export Process nothing happens. It does not update the EAD. Here is the custom code from the directive:
using (var updater = this.getDataUpdater("Erp", "EAD"))
{
var EADType = Db.EADType.FirstOrDefault(
tableRow => tableRow.EADType1 == "IP");
if (EADType.EADType1 != null)
{
EADType.EarliestApplyDate = BpmFunc.Today();
}
}
foreach (var ttResult in ttResults)
{
ttResult.RowMod = "";
}
Why would this code not update the EAD in the Export? My goal is to have this run on a weekly schedule.
I did some research and found that the BPMs don’t update when you schedule it to run. I did more digging and found that you can schedule an Epicor function where you can put custom code in. I created a library, added the desired table as a reference, created a custom code function with the following code and ran it via Schedule Epicor Function and ran it Now. Low and behold this worked!
var EAD = Db.EADType.Where(e => e.EADType1 == "IP");
foreach (var EA in EAD)
{
EA.EarliestApplyDate = BpmFunc.Today();
}
Db.SaveChanges();
Is yours doing an update to data? I found that while it does trigger the GetList, the update part does not work. I may not have phrased my previous post correctly.