首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Epicor 10在BPM工作流设计器中链接BAQ (避免自定义代码)

Epicor 10在BPM工作流设计器中链接BAQ (避免自定义代码)
EN

Stack Overflow用户
提问于 2017-05-24 20:55:35
回答 1查看 752关注 0票数 0

目前,我的任务是审查Epicor创建的BPM,该BPM没有如预期的那样运行。目前,BPM基于下面的代码,其目的是在系统中引用订单,当其发运订单的时间发生变化时,订单/部件将反映一个新的价格。该代码似乎导致从预期不到的客户那里检索到不正确的价目表。例如,价目表附加到客户#1242,但它根据客户#1269更新价格。(猜测它们共享一个公共部分#,代码检索最新值)

现在我的问题是,我没有编写代码的经验,我以前看过代码,但在很小的程度上,从我上面列出的内容来看,这些代码是提供给我的。现在,我认为可能更容易理解的做法是在BPM中创建BAQ和引用,并利用BAQ作为BPM更新价格的参考。

通过研究一些论坛和Epicors培训材料,我还没有找到关于如何将BAQ与BPM连接起来的明确答案。

(同样,如果我的描述有意义,并且代码反映了这个问题,请随意猜一猜)

BPM代码:

代码语言:javascript
复制
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;     
                                                                                            }
                                                    } 
                                                     }
          } 
        } 
    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-31 12:11:46

我解析了代码,但仍然无法确定在BPM中链接BAQ的有效方法。

问题是缺少了以下代码:

代码语言:javascript
复制
&& ttShipHead_xRow.CustNum == ShipDtl_Row. CustNum

到第一个foreach语句。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44168295

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档