SAP C4C OBN(Object Based Navigation)不能工作的原因分析

i042416發表於2020-09-24

My series of Cloud Application Studio Blogs

I have created two OBN button in Service Request TI item table’s toolbar via extensibility explorer.


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


My expectation is that once button “toStandardQC” is pressed, the standard Service Request QC view will be displayed, see example below. And When button “Jerry Create” is clicked, a new custom QC view will be displayed instead. As you can see from screenshot above, the “Jerry Create” button is disabled in the runtime. Why?


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


Here below is how I analyze this issue.

(1) In design time the enable attribute of this button is set as true as expected. Note down the name of automatically generated event handler for onClick event:EV_NAME_f8067313a9424b3e89b2370b3b2a1f5a


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


If you set breakpoint in file ButtonWrapper, function initializeControl, you can observe that the instance of this button is created in the runtime.


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


(2) The enable property of OBN button is bound to the automatically generated data model field, whose path is/EventHandler/EV_NAME_f8067313a9424b3e89b2370b3b2a1f5a.Enabled. For the button “JerryCreate”, the value of bound model field is false, so in the runtime this OBN button is disabled.


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


Just check the other OBN button which works correctly, and the bound data field has value “true”.


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


You can also inspect the data model field value by appending “debugMode=true” in C4C URL and check value from Client Inspector in the popup.


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


(3) Now we need to figure out why data model field for “Jerry Create” button is determined as false in the runtime. In Chrome development tool, check the HTTP response for ServiceRequest TI page. Search the response by keyword “1f5a”:


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


In the hit you can find the root cause: the OBN target – my custom new QC view, is not put to any work center yet.


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


So solution is quite simple, just create a new work center, a new work center view and put this new QC view to the work center view, and assign the work center view to my test user.


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


After that the “Jerry Create” OBN button works as well:


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


Once created, the new custom QC view could be displayed correctly as well.


SAP C4C OBN(Object Based Navigation)不能工作的原因分析


For the complete solution for this OBN enablement, please refer to blog  Step by step to create OBN button which navigates from standard UI to custom UI.

要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":

SAP C4C OBN(Object Based Navigation)不能工作的原因分析


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2723725/,如需轉載,請註明出處,否則將追究法律責任。

相關文章