打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
How to Call Business Object Using C# Code In Epicor 10

Call Business Object Using C# Code in Epicor 10

Home  /  Transforming Business Through Software  /  Business Leaders Maximizing Technology  /  Call Business Object Using C# Code in Epicor 10

6
Shares
6

Call Business Object Using C# Code

A couple weeks ago we posted how to do this using ABL?4GL code; however we received several inquires regarding the code for performing this same action in Epicor version 10.

Below is the source code that you can insert to automate Epicor business processes by calling a business object using C# code.

Here is the source.

Method directive on ABCCode.Update  add reference to UD01 assembly: Ice.Contracts.BO.UD01  no "using" statements required   /*Delcare a UD01DataSet variable */ var UD01DataSet = new  Ice.Tablesets.UD01Tableset();  /* Declare variable hUD01 of type Ice.Contracts.UD01SvcContract and set its value to null */ Ice.Contracts.UD01SvcContract hUD01 = null;  /* Select the first ttABCCode if it exists and store it in a new variable ttAbccode_xRow */ var ttAbccode_xRow = (from ttAbccode_Row in ttABCCode                       select ttAbccode_Row).FirstOrDefault();  /*Set the value of hUD01 */ hUD01 = Ice.Assemblies.ServiceRenderer.GetService(Db);  /* If hUD01 is not null: */ if (hUD01 != null) { /* call the hUD01 object's GetaNewUD01 method and put the result into the UD01DataSet variable */     hUD01.GetaNewUD01(ref UD01DataSet);      /* Get the first row from the UD01DataSet, if it exists */     var ttUD01_xRow = (from ttUD01_Row in UD01DataSet.UD01                        where ttUD01_Row.RowMod == "A"                        select ttUD01_Row).FirstOrDefault();      if (ttUD01_xRow != null)     {         /* Assign values in the new UD01 record. */         ttUD01_xRow.Company = Session.CompanyID;         ttUD01_xRow.Key1 = "AbcCode";               /*Table that was affected*/         ttUD01_xRow.Key2 = "CountFreq";             /*Field that was affected*/         ttUD01_xRow.Key3 = DateTime.Now.ToString("HH:MM:SS"); /*Time*/         ttUD01_xRow.Key4 = System.Guid.NewGuid().ToString();   /*Unique Identifier*/         ttUD01_xRow.Date01 = DateTime.Now;                   /*Date*/         ttUD01_xRow.Number01 = ttAbccode_xRow.CountFreq;     /* Value from AbcCode */         ttUD01_xRow.ShortChar01 = Session.UserID;            /*User id*/         /*Commit record*/         hUD01.Update(ref UD01DataSet);     } }

Can the experts at Datix help you with a problem?

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
利用www.google.com入侵的拓扑图
成功解决AttributeError: ‘DataFrame‘ object has no attribute ‘ix‘
dataset如何批量更新添加数据库
JavaScript单词汇总
数据集处理技术 DataReader DataTable DataSet 之间的转换
GridView和下拉菜单DropDownList结合
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服