Epicor 10 在 BPM Workflow Designer 中链接 BAQ(避免自定义代码)
Epicor 10 Linking a BAQ in BPM Workflow Designer (Avoiding Custom Code)
目前,我的任务是审查 Epicor 创建的未按预期运行的 BPM。目前,基于以下代码的 BPM 的目的是参考系统中的订单,如果价格发生变化,则在发货时 order/part 将反映新价格。似乎该代码导致从意想不到的客户那里检索到不正确的价目表。例如,价目表附加到客户 #1242,但它根据客户 #1269 更新价格。 (猜测它们共享一个公共部分 # 并且代码检索最新值)
现在我的问题是我没有编写代码的经验,我之前已经审查过代码,但只是在很小的程度上审查过我上面列出的提供给我的代码。现在我认为对我来说更容易理解的做法是创建一个 BAQ 并在 BPM 中引用它,并利用 BAQ 作为 BPM 更新价格的参考。
通过研究一些论坛和 Epicors 培训 material 我还没有找到关于如何 link BPM 中的 BAQ 的明确答案。
(另外,如果我的描述有意义并且代码反映了问题,请随意猜测)
BPM代码:
var ttShipHead_xRow = (from ttShipHead_Row in ttShipHead
where ttShipHead_Row.ReadyToInvoice == true
select ttShipHead_Row).FirstOrDefault();
if (ttShipHead_xRow != null)
{
foreach (var ShipDtl_iterator in (from ShipDtl_Row in Db.ShipDtl
where ttShipHead_xRow.PackNum == ShipDtl_Row.PackNum
&& ttShipHead_xRow.Company == ShipDtl_Row.Company
select ShipDtl_Row))
{
var ShipDtl_xRow = ShipDtl_iterator;
//ShipDtl_xRow.UnitPrice = 1;
var today = DateTime.Today;
var PriceList_xRow = (from PriceLst_Row in Db.PriceLst
from PriceLstParts_Row in Db.PriceLstParts
where ShipDtl_xRow.PartNum == PriceLstParts_Row.PartNum
&& PriceLst_Row.ListCode == PriceLstParts_Row.ListCode
&& PriceLst_Row.Company == PriceLstParts_Row.Company
&& PriceLst_Row.Company == ShipDtl_xRow.Company
&& PriceLst_Row.EndDate >= today
select PriceLstParts_Row).FirstOrDefault();
if (PriceList_xRow != null)
{
var OrderDtl_xRow = (from OrderDtl_Row in Db.OrderDtl
where ShipDtl_xRow.OrderLine == OrderDtl_Row.OrderLine
&& ShipDtl_xRow.PartNum == OrderDtl_Row.PartNum
&& ShipDtl_xRow.OrderNum == OrderDtl_Row.OrderNum
&& ShipDtl_xRow.Company == OrderDtl_Row.Company
select OrderDtl_Row).FirstOrDefault();
{
if (OrderDtl_xRow != null)
{
if (ShipDtl_xRow.UnitPrice != PriceList_xRow.BasePrice)
{
ShipDtl_xRow.UnitPrice = PriceList_xRow.BasePrice;
}
if (ShipDtl_xRow.UnitPrice != OrderDtl_xRow.UnitPrice)
{
OrderDtl_xRow.DocUnitPrice = PriceList_xRow.BasePrice;
OrderDtl_xRow.UnitPrice = PriceList_xRow.BasePrice;
}
}
}
}
}
}
我解析了代码,但仍然无法确定 link BPM 中 BAQ 的有效方法
问题是缺少以下代码:
&& ttShipHead_xRow.CustNum == ShipDtl_Row. CustNum
到第一个 foreach 语句。
目前,我的任务是审查 Epicor 创建的未按预期运行的 BPM。目前,基于以下代码的 BPM 的目的是参考系统中的订单,如果价格发生变化,则在发货时 order/part 将反映新价格。似乎该代码导致从意想不到的客户那里检索到不正确的价目表。例如,价目表附加到客户 #1242,但它根据客户 #1269 更新价格。 (猜测它们共享一个公共部分 # 并且代码检索最新值)
现在我的问题是我没有编写代码的经验,我之前已经审查过代码,但只是在很小的程度上审查过我上面列出的提供给我的代码。现在我认为对我来说更容易理解的做法是创建一个 BAQ 并在 BPM 中引用它,并利用 BAQ 作为 BPM 更新价格的参考。
通过研究一些论坛和 Epicors 培训 material 我还没有找到关于如何 link BPM 中的 BAQ 的明确答案。
(另外,如果我的描述有意义并且代码反映了问题,请随意猜测)
BPM代码:
var ttShipHead_xRow = (from ttShipHead_Row in ttShipHead
where ttShipHead_Row.ReadyToInvoice == true
select ttShipHead_Row).FirstOrDefault();
if (ttShipHead_xRow != null)
{
foreach (var ShipDtl_iterator in (from ShipDtl_Row in Db.ShipDtl
where ttShipHead_xRow.PackNum == ShipDtl_Row.PackNum
&& ttShipHead_xRow.Company == ShipDtl_Row.Company
select ShipDtl_Row))
{
var ShipDtl_xRow = ShipDtl_iterator;
//ShipDtl_xRow.UnitPrice = 1;
var today = DateTime.Today;
var PriceList_xRow = (from PriceLst_Row in Db.PriceLst
from PriceLstParts_Row in Db.PriceLstParts
where ShipDtl_xRow.PartNum == PriceLstParts_Row.PartNum
&& PriceLst_Row.ListCode == PriceLstParts_Row.ListCode
&& PriceLst_Row.Company == PriceLstParts_Row.Company
&& PriceLst_Row.Company == ShipDtl_xRow.Company
&& PriceLst_Row.EndDate >= today
select PriceLstParts_Row).FirstOrDefault();
if (PriceList_xRow != null)
{
var OrderDtl_xRow = (from OrderDtl_Row in Db.OrderDtl
where ShipDtl_xRow.OrderLine == OrderDtl_Row.OrderLine
&& ShipDtl_xRow.PartNum == OrderDtl_Row.PartNum
&& ShipDtl_xRow.OrderNum == OrderDtl_Row.OrderNum
&& ShipDtl_xRow.Company == OrderDtl_Row.Company
select OrderDtl_Row).FirstOrDefault();
{
if (OrderDtl_xRow != null)
{
if (ShipDtl_xRow.UnitPrice != PriceList_xRow.BasePrice)
{
ShipDtl_xRow.UnitPrice = PriceList_xRow.BasePrice;
}
if (ShipDtl_xRow.UnitPrice != OrderDtl_xRow.UnitPrice)
{
OrderDtl_xRow.DocUnitPrice = PriceList_xRow.BasePrice;
OrderDtl_xRow.UnitPrice = PriceList_xRow.BasePrice;
}
}
}
}
}
}
我解析了代码,但仍然无法确定 link BPM 中 BAQ 的有效方法
问题是缺少以下代码:
&& ttShipHead_xRow.CustNum == ShipDtl_Row. CustNum
到第一个 foreach 语句。