SAP Cloud for Customer CLR(Code List Restriction)的一种高级用法
My series of Cloud Application Studio Blogs
- How to detect EditMode in an Embedded Component
- Step by step to enable your custom BO with attachment upload functionality
- Step by step to create an Adobe Print form in Cloud application Studio
- How to render PDF which displays picture from the image attachment of your custom BO
- How to get current logged on business user’s employee information and assigned organization unit via ABSL
- How to implement dynamic access control based on custom BO using OWL
- How to make Code List Restriction work when control field and restricted field are not on the same BO
- How to implement custom number range using custom business object
Customer has requirement that code list for field Function in Contact creation page should be restricted based on the role code in Account TI.
Technically the control field above is modeled in this field as below: ( in BO BusinessPartner )
And the restricted field Function is in another BO: BusinessPartnerRelationship
In this case it is not possible to use the RoleCode field to control the Function field.
Fortunately besides Business Field, it is supported to use an extension field to perform CLR( Code List Restriction ) as well.
Here below are detailed steps:
(1) Create an extension field with indicator data type on Root node of BusinessPartnerRelationship:
(2) Create an AfterModify event implementation to manually copy the value of RoleCode from BusinessPartner BO to the indicator extension field:
import ABSL;
import AP.FO.BusinessPartner.Global;
var bpID = this.ContactPerson.ToRoot.FirstBusinessPartner.InternalID;
var queryByID = Customer.QueryByIdentification;
var queryByIDParameter = queryByID.CreateSelectionParams();
queryByIDParameter.Add( queryByID.InternalID, "I", "EQ", bpID );
var result = queryByID.Execute(queryByIDParameter);
var first = result.GetFirst();
var common = first.Common.GetFirst();
var RoleCode = common.ToRoot.CustomerRole.RoleCode.content;
if( RoleCode == "BUP002" ){ // prospect
this.ZRoleIndicator = true;
}
else{
this.ZRoleIndicator = false;
}
(3) Add this extension field to Quick Creation UI via Extensibility Explorer:
(4) Now it is ready to create a code list restriction based on this indicator extension field: it is now available in Control Field drop down list:
Just define corresponding value for Prospect ( indicator equals to true ) and Customer ( indicator equals to false ):
And it works in the runtime: in contact creation page, only a subset of specified entries in CLR maintenance UI is displayed.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- SAP UI5 应用开发教程之一百零二 - SAP UI5 应用的打印(Print)功能实现详解试读版
- SAP UI5 OData API binding.filter(filter) 会触发发往后台的 OData 请求
- SAP Cloud for Customer最新版本2002 RUI如何启用adaptation模式
- ABAP Netweaver, SAP Cloud Platform和Kubernetes的用户区分
- SAP Spartacus 服务器端渲染单步调试步骤之一:应用程序准备工作
- SAP Spartacus B2B Unit page OrgUnitService.getTree方法返回的结果
- SAP Spartacus可供demo用途的Commerce Cloud public instance
- 打印SAP CRM relationship STRSET的业务数据
- SAP Cloud for Customer根据Accouunt自动带出Sales Unit的配置
- 浅谈SAP Cloud for Sales 自动化
- SAP Cloud for Customer跨component的跳转
- 如何创建新的SAP CRM middleware subscription
- SAP OData CSRF token的后台验证源代码
- 如何在SAP云平台的Cloud Foundry环境下添加新的Service(服务)
- SAP BTP 平台 Cloud Application Programming 编程模型概述
- SAP Commerce Cloud CMS 里的一些元素类型
- SAP Analytics Cloud连接Cloud for Customer的一些后台调试
- SAP UI5 Tools 运行了 fiori add deploy-config 命令之后,工程文件发生了哪些变化
- SAP UI5 sap.viz.ui5.controls.VizFrame 的 aggregation 之一:dataset
- SAP UI5 应用 index.html 里各个属性赋值逻辑的讲解
- 使用 SAP WebIDE 将SAP UI5 应用部署到 SAP ABAP Netweaver 服务器上