In release 1708 the Recipient Determination to “Reporting Line Manager” in Opportunity is available:

However for Account application, there are only six available determination rules available in standard.

Suppose we need to support the following scenario:

Max is Jerry’s manager. When Jerry has changed a given kind of Account in system, Max will get an email notification triggered by workflow. The general idea to fulfill this requirement is to introduce a logic which could automatically make Max as one member in Account Team table in Account TI by a small development in Cloud Application Studio, so that the existing functionality provided by Workflow framework could be leveraged to send notification.

Here below is the solution.

(1) Create a new custom Party Role Code and define it as Recipient determination in Workflow rule edit UI by following this blog Custom recipient determination in workflow rule done on Account BO.
Of course you can also use standard role code.

(2) Create a beforeSave script file on Root node of Customer Business Object:

import ABSL;
import AP.PC.IdentityManagement.Global;var managerExists = this.CurrentEmployeeResponsible.Where(x=>x.PartyRoleCode.Contains("ZJE"));
if( managerExists.Count() <= 0){var queryByIdentityUUID = Identity.QueryByElements;var queryByIdentityUUIDParameter = queryByIdentityUUID.CreateSelectionParams();var queryByEmployeeBPUUID = Employee.QueryByIdentification;var queryByEmployeeBPUUIDParameter = queryByEmployeeBPUUID.CreateSelectionParams();var id = Context.GetCurrentIdentityUUID().content;queryByIdentityUUIDParameter.Add( queryByIdentityUUID.UUID.content, "I", "EQ", id.ToString() );var result = queryByIdentityUUID.Execute(queryByIdentityUUIDParameter);var first = result.GetFirst(); // points to identity instancevar person = first.Person;var bpUUId = person.UUID.content;queryByEmployeeBPUUIDParameter.Add( queryByEmployeeBPUUID.UUID.content, "I", "EQ", bpUUId.ToString());var employeeQueryResult = queryByEmployeeBPUUID.Execute(queryByEmployeeBPUUIDParameter);var EmployeeQueryResultCurrent = employeeQueryResult.GetFirst();var assignedOrg = EmployeeQueryResultCurrent.OrganisationalUnitAssignment.GetFirst();var org = assignedOrg.ToRoot;var manager = org.Manager.GetFirst();firstCommon.CustomExtension = manager.EmployeeUUID.content;var newNode: elementsof Customer.CurrentEmployeeResponsible;newNode.EmployeeUUID.content = manager.EmployeeUUID.content;newNode.PartyRoleCode = "ZJE";this.CurrentEmployeeResponsible.Create(newNode);
}

The idea of this code: first check whether the line manager is already maintained as one member of current Account team ( in this example I use a custom Party Role Code ZJE to represent Line Manager role ), if not, then query the corresponding line manager of current logon user and create a new Account team member dynamically.
In the runtime, the behavior is that once Jerry creates a new account, Jerry’s manager Max will automatically become as one Account Team member and received a notification Email:


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

SAP Cloud for Customer使用工作流(workflow)实现邮件自动通知功能相关推荐

  1. SAP Cloud for Customer里的HTML Mashup的JavaScript编程功能

    SAP Cloud for Customer的HTML Mashup,可以在HTML编辑器里进行简单的JavaScript编程,并在其中使用C4C标准页面里Business object字段的值. 比 ...

  2. SAP Cloud for Customer 标准培训课程

    经常有朋友在我的SAP技术交流群或者我的公众号汪子熙给我留言,询问一个ABAP开发人员如果想学习SAP Cloud for Customer,应该从哪些方面入手. 这里把SAP官方的和SAP Clou ...

  3. SAP Cloud for Customer Price-计价简介

    SAP Cloud for Customer(本文以下简称C4C)作为SAP新一代的CRM云产品,其Price功能实现虽不如以前的SAP ERP那么复杂,但是也能满足企业运作中各种Price需求. C ...

  4. 如何在 SAP Cloud for Customer 里自定义消息 Message

    在 SAP Cloud for Customer 里,虽然 Partners 不允许直接登录 ABAP 后台,但仍旧可以通过 Cloud Application Studio 新建显示在 UI 上的消 ...

  5. SAP CRM 和 SAP Cloud for Customer 的表格列项目宽度调整的原理介绍

    这是 Jerry 2021 年的第 37 篇文章,也是汪子熙公众号总共第 313 篇原创文章. Jerry 之前的文章 一个 SAP 开发工程师十余年的技术写作之路回顾 曾经提到,知乎上安晓辉老师的一 ...

  6. SAP Cloud for Customer 如何直接消费S/4HANA API

    最近有朋友在微信上问我本文标题这个需求,如何在 SAP Cloud for Customer 里实现.正好我在 2018年底参加的 SAP 和沈阳自动化研究所合作设计的一个工业 4.0 示范系统 PO ...

  7. SAP Cloud for Customer Cloud Application Studio的Trace功能

    You can activate tracing on any system that you can log on to with your developer user account. When ...

  8. SAP Cloud for Customer UI Designer里如何消费Object Value Selector(OVS)

    先看最后实现的效果: 我有一个字段,用户既手动输入Employee ID,也可以点击字段的矩形框,打开Value help: 假设我选中ID为1的Employee,则其first name和last ...

  9. SAP Cloud for Customer 技术概述

    SAP Cloud for Customer 标准培训课程 文章目录 SAP Cloud for Customer 架构 SAP Cloud for Customer 部署的三种方式 SAP Clou ...

最新文章

  1. 【BIO】基于BIO实现简单动态HTTP服务器
  2. 转 AIX7.2+11.2.0.4RAC实施
  3. python数据库编程(1):潦草的开篇
  4. Kafka会不会丢消息
  5. 分析按键序列以执行不同功能。但又从中抽象出来一个,暂时不知道还能用作别的不。...
  6. 吃的苦中苦,方为人上人!
  7. Hadoop Yarn源码 - day1
  8. Centos5.5系统备份
  9. 教你用电脑从 Google Play 下载 Android 程序 apk 文件
  10. 基于Python和OpenCV的图像目标检测及分割
  11. 计算机自动化专业强的二本大学,2020自动化专业大学排名公布
  12. 立创eda专业版学习笔记(3)(隐藏部分飞线)
  13. 初学OpenGL(7):颜色和光照
  14. word使用的奇技淫巧
  15. python moviepy 从视频中提取音频
  16. Flink-Connectors(连接器)(1)JDBC
  17. Apache Jakarta 项目介绍
  18. 盘一盘 QuantLib 系列 2 - 生成日期表
  19. Python如何获取 Jenkins构建日志
  20. 目标检测中的数据增强,包括bbox的变换

热门文章

  1. disaster——我都做了些什么啊!
  2. 【CCL】连通区域提取
  3. puppet kick 功能实现
  4. 到国外使用wifi悠着点防止天价帐单
  5. Spring 学习——Spring AOP——AOP配置篇Advice(有参数传递)
  6. [51nod] 1267 4个数和为0
  7. jQuery操作iframe中js函数的方法小结
  8. 0909关于操作系统
  9. CSS样式特点及优先级
  10. UIAlertView UIActionSheet随笔笔记