码迷,mamicode.com
首页 > 其他好文 > 详细

如何将SAP Cloud for Customer的扩展字段放置到Embedded Component中

时间:2020-09-12 21:42:43      阅读:46      评论:0      收藏:0      [点我收藏+]

标签:handler   https   using   ant   chrome   splay   fill   customer   display   

My series of Cloud Application Studio Blogs

Requirement

Create extension field , put it to a given embedded component and finally make it visible in standard UI.

(1) Create an extension field on Opportunity root node and implement an action to calculate whether the current opportunity is over due:

技术图片

The check logic for over due is simply based on the comparison between current system date and closed date maintained in opportunity header.

import ABSL;
var current = Context.GetCurrentGlobalDateTime( ).GetDate();
var close = this.SalesForecast.ExpectedProcessingDatePeriod.EndDate;
this.IsOverDue = current.GreaterThan(close);

(2) Create a new embedded component OppEC, create two data field and bind them to standard BO field ID and extension field IsOverDue.

技术图片

Create a checkbox UI element in the embedded component and bind it to ID field.
Create a button in order to execute OverdueCheck action.

技术图片

Switch to embedded component’s controller tab, create an unbound data field OpportunityID, and use it as BOOperation Read’s parameter. This unbound data filled will be filled with values passed from inport to be created soon.

技术图片

Create an inport and declare the parameter bound to OpportunityID.

技术图片

Assign the created event handler to OnFire attribute of this inport.

Create another event handler overDueCheck and bind the BO action OverdueCheck whose implementation is done by our ABSL code.

技术图片

(3) Add the embedded component to Opportunity TI overview tab,

技术图片

and bind the parameter defined in standard outport to the parameter declared in my custom inport in embedded component OppEC:

技术图片

Now we could test in UI: select an opportunity whose close date is yesterday, and click check button:

技术图片

After that the is Overdue check box is set as selected, meantime we could observe the corresponding roundtrip from Chrome development tool which indicates the due check is done successfully with due indicator marked as X:

技术图片

要获取更多Jerry的原创文章,请关注公众号"汪子熙":
技术图片

如何将SAP Cloud for Customer的扩展字段放置到Embedded Component中

标签:handler   https   using   ant   chrome   splay   fill   customer   display   

原文地址:https://www.cnblogs.com/sap-jerry/p/13592131.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!