日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發布時間:2023/12/19 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SAP Cloud for Customer使用工作流(workflow)实现邮件自动通知功能 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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)实现邮件自动通知功能的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。