如何在SAP C4C AdvancedListPane上批量執行若干BO例項的action
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
- Two approaches to create Code List in Cloud Studio
- Create Dynamic Code List via Custom Business Object Association
- Step by step to develop Thing Type based navigation and BO Object based navigation
- Put Extension field into embedded component and make it visible in Standard UI
- One possible cause that embedded component fails to display in UI
- Step by step to create HTML Mashup and make it visible in UI
- Step by step to enable Text Collection for your custom BO
- Automatically send an Email notification to line manager via Workflow in Account application
- Step by step to create Object Value Selector in Cloud Application Studio
- Two approaches to fill an UI field with dedicated logic implemented in Cloud Application Studio
- How to execute BO action on multiple selected BO instances in AdvancedListPane
- How to add custom validation logic on mobile phone field in Contact TI
Recently one partner asked me about this question. Suppose I have a custom BO with one Date field “CloseDate”, and one indicator field “IsOverDue”.
There is an action “OverDueCheckMass” defined with the simple logic that if current date < Close Date, then I consider the order as Overdue and vice versa. The source code of this action implementation:
import ABSL;var current = Context.GetCurrentGlobalDateTime( );foreach( var rootNode in this ){
var closeDate = rootNode.CloseDate.ConvertToGlobalDateTime();
rootNode.IsOverDue = current.LessThan(closeDate);}
This action is marked as Mass-enabled.
Requirement is: in the table implemented by AdvancedListPane in UI Designer, if several rows are selected by Ctrl+Click ( Or Shift + Click ), once the button “Overdue check” is pressed, the action must be performed on those selected rows.
Take the below screenshot as example, the first and fourth row are selected, it is expected that after OverDue check is executed, IsOverDue indicator for the first row is determined as Yes.
Here below is details step how this requirement could be fulfilled.
(1) Specify the List SelectOption property as “multiSelectWithLeadSelection”.
Create a Data List in DataModel tab:
(2) Create an event handler with type BOAction. For instance Binding attribute, bind it to the Data List created in previous step. Choose “multiple” as Action Type and bind this event handler to BO Action OverDueCheckMass.
By default when you create a new event handler, Action Type is always set as single by default. Don’t worry, once you bind this action to the Instance Binding which points to a Data List in your Data Model and the BO action implementation is Mass-Enabled, once you click bind button, this Action Type will change into multiple automatically.
After these two steps are done, select the first and fourth row and press the OverDue check button – it works as expected.
How it works under the hood
Suppose you have first pressed Ctrl key and then select the first and fourth row, how UI5 framework reacts to this event? Set a breakpoint on function OnClick of file TablePointerExtension.js, and there is one attribute ctrlKey in the native HTML event object which indicates whether the Ctrl key is pressed in current event.
With this indicator, UI5 framework could react accordingly:
Since I have selected the SelectOption of my list as multiSelect, so UI5 uses an array to store the selected rows’ indexes:
Now when you click Overdue Check button with the state that first and fourth rows are selected, the breakpoint set in method SendAsyncPostRequest in file Request.js will be triggered. Check what exactly the data will be sent to backend by inspecting variable mParameters:
It clearly shows that the node ID of selected two BO instances are passed to backend for action execution.
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2724401/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何在 vuex action 中獲取到 vue 例項Vue
- 如何讓SAP C4C自定義BO實現附件上傳的功能
- 如何使用SAP C4C Repository Explorer裡的BO test shell
- 如何在 SAP BTP 上 手動執行 workflow
- 如何啟用SAP C4C自定義BO的Text Collection功能
- SAP HANA Cloud 學習教程之一: 如何在 SAP BTP 上建立 SAP HANA Cloud 例項Cloud
- Activiti的流程例項【ProcessInstance】與執行例項【Execution】
- 如何在阿里雲上執行SAP UI5應用阿里UI
- Thread 併發執行例項thread
- NCF的Dapr應用例項的執行
- 如何在SAP Cloud for Customer自定義BO中建立訪問控制Cloud
- 唯一標識 Java 執行的例項Java
- 執行caffe自帶的mnist例項教程
- 使用OData服務將SAP C4C自定義BO的TextCollection暴露給外部消費者
- Qt中的多執行緒與執行緒池淺析+例項QT執行緒
- Linux中執行多個MySQL例項LinuxMySql
- docker 執行elasticsearch單例項(elasticsearch:7.12.0)DockerElasticsearch單例
- 刪除所有正在執行和退出的docker例項Docker
- eventlet 之 monkeypatch 帶來的若干相容性問題例項分析
- 在Windows中執行多個MySQL例項WindowsMySql
- Python程式和執行緒例項詳解Python執行緒
- win系統如何在mac上執行Mac
- Spring-Mybatis的批量執行SpringMyBatis
- 如何將SAP C4C自定義BO中型別為圖片的附件用PDF文件顯示出來型別
- SAP UI5 xml 檢視裡定義的控制元件,執行時如何建立其例項的?UIXML控制元件
- python自動化指令碼例項100條-自動化運維基礎例項解析-Python批量登入到伺服器執行任務...Python指令碼運維伺服器
- teprunner測試平臺測試計劃批量執行用例
- 如何在SAP C4C的Embedded元件中檢測編輯模式(EditMode)元件模式
- Java 例項 - 如何檢視當前 Java 執行的版本?Java
- 使用Eclipse連線SAP雲平臺上的HANA資料庫例項Eclipse資料庫
- 【爬蟲】Heritrix 3.2安裝和執行例項爬蟲
- 例項後臺執行訓練或任務
- 執行緒問題2(注意例項變數)執行緒變數
- 將SAP C4C Custom BO使用ABSL編寫的邏輯通過OData服務暴露出去
- 一步步使用SAP C4C Cloud Application Studio建立一個BO和對應的螢幕CloudAPP
- 如何在LInux上安裝並執行JenkinsLinuxJenkins
- 在Kubernetes上執行SAP UI5應用(上)UI
- SAP雲平臺上兩個ABAP系統例項之間的互連