You are on page 1of 41

Epicor Function

Epicor 10.2、Kinetic 2021

Data World Solution Limited


培训目标
• Epicor Function权限设置
• 新增Library及Function
• Epicor Function在BPM中调用
• Epicor Function在Application Studio应用工作室调用
Epicor Function
• 用户设置建立维护Epicor Function的权限。
• Functions Administrator 只能管理Function部分设置及应用到哪些公司,不能增加
及修改Library、Function。
• Functions Developer 可以增加及修改Library、Function,但不能建立带Code的
Function,不能选择应用到哪些公司。
• Functions Power Developer 可以增加及修改Library、Function,能建立带Code的
Function,不能选择应用到哪些公司。
Epicor Function
• System Management->Business Process Management->Epicor Functions
Maintenance
• 新建Library:PartMaint。
• 选择这个Library的Function权限:
• Custom Code Widgets: 可以建立带代码的工具Function。
• Custom Code Functions:可以建立纯代码的Function。
• DB Access from Code: 代码对数据表的权限,Read Only只读,Read Write读写。
• For internal Use Only: 不要勾选。
Epicor Function
• 在References->Tables 点击Add按键。
Epicor Function
• 搜索选择Function中用到的Vendor表。
Epicor Function
• 选择哪些公司可以应用这个Library。
Epicor Function
• 增建Add Custom Code Function。
• 输入Function ID: funcGetVendorComment,不要用-符号作为Function ID,App
Studio调用时会有问题。
• 设置传入参数ipVendorNum,System.Int32。
• 设置输出参数Function ID,System.String。按Complete键完成。
Epicor Function
• 按Edit键进入编写功能代码。
Epicor Function
• 编写跟据传入参数ipVendorNum查找Vendor.Comment数据的代码。
Epicor Function
• C# LINQ查询语法代码

string Company = this.callContextClient.CurrentCompany;


int VendorNum = this.ipVendorNum;

foreach (var Vendor_iterator in (from Vendor_Row in Db.Vendor


where string.Compare(Company, Vendor_Row.Company, true) == 0 && VendorNum == Vendor_Row.VendorNum
select Vendor_Row))
{
var xVendor = Vendor_iterator;

this.opComment = (string)xVendor["Comment"];
}
Epicor Function
• Function设计完,在Action选择Promote Library to Production发布。
• 如需修改function,需要选Demote Library from Production之后才能修改,这时
Library中的所有function在BPM或App Studio调用不会生效。
Epicor Function
• 建立的Function在BPM中应用
• 在Method Directives选择Erp.BO.Part.ChangePartPlantVendorID方法
Epicor Function
• 建立Post-Processing,按Design。
Epicor Function
• 拖入Invoke BO Method工具,设置工具属性,选择Library及Function,按configured
配置参数。
Epicor Function
• 设置传入参数,选择PartPlant表的VendorNum字段。
Epicor Function
• 设置传出参数,建立新的VendorComment变量接收。
Epicor Function
• 拖入Show Message工具显示VendorComment。
Epicor Function
• 在信息框按鼠标右键,选择VendorComment变量。
Epicor Function
• 设置完成,启动BPM。
Epicor Function
• 在物料维护,站点页选择供应商,BPM显示供应商Comment信息。
Epicor Function
• 建立的Function在Kinetic Application Studio应用工作室应用
• 在System Setup->Security Maintenance->Access Scope中需要先设置增加Library。
Epicor Function
• 在System Setup->Security Maintenance->API Key Maintenance设置API Key。
Epicor Function
• System Management->Application Studio 修改物料维护功能。
Epicor Function
• 选择Use Layer
Epicor Function
• 点击NewLayer
Epicor Function
• 输入LayerName,应用在ALL所有公司或选当前公司。然后Save Layer。
Epicor Function
• 从事件里面找到ChangePartPlantVendorID打开。
Epicor Function
• 拖入erp-function工具。
Epicor Function
• 设置erp-function属性。
• 输入API Key。
• 选择Library。
• 选择Function。
Epicor Function
• 设置Method Parameters。
• Field Value输入作为参数传入的Data View字段:PartPlant.VendorNum
Epicor Function
• 返回设置Response Parameters,按加号键增加一个参数。
• Parse from Response Path输入returnObj,这是返回的对象。
Epicor Function
• 设置Dataset属性。
• Dataset Id输入TransView。
Epicor Function
• 返回设置erp-function的OnSuccess属性。
Epicor Function
• 选中erp-message-handler工具。
Epicor Function
• 设置erp-message-handler工具属性Param。
Epicor Function
• 设置erp-message-handler工具Param的属性
• Message输入{actionResult.opComment},opComment是Function输出的参数变量名。
Epicor Function
• 设置完成,按右上角的播放键,预览测试。
Epicor Function
• 选择站点的供应商,弹出显示调用Function输出的Supplier Comment值。
Epicor Function
• 有关Epicor Function的更多介绍,请参考
KineticICEToolsClassicUX_UserGuide_2021.1.pdf 的Epicor Functions章节。
Epicor Function

•END

You might also like