A bit more to add to C4C UI Rules

UI rules in SAP Service / Sales Cloud are great. They help to make fields visible, read-only or mandatory based on conditions. They help to hide some buttons in Actions menus for certain business roles. They make validation messages possible. They help quite a lot.

But. There is always a “but”. But the number of fields available in the field names list in UI Rules Editor is limited. Honestly, I don’t know the reason. The system doesn’t provide us with all the available fields.

For example, in the ticket TI we won’t find the following fields in UI rule available fields list:

  • Released to FSM (which is at the header level and indicates if the ticket was released to SAP FSM or not yet)
  • Order block (which comes from customer’s sales arrangement and available in “Integration” section on “Overview” tab)
  • Item processing type (which drives the item handling process)

And here we’re going to find out how to use any field available on the screen in our UI rule. To be precisely correct, any field which is available in the Data Model of the particular screen.

For this, we either need a hand from our fellow technical colleague to look up the field in SDK. Or we will need to get some help from “debug mode” in UI. I described it in details in one of my previous posts. The debugMode (aka Client Inspector) is an awesome tool which helps to explore any screen without using SDK. It can be enabled by adding debugMode=true to your usual C4C URL.

Once it’s enabled, we should check the field we want to use in our UI rule and find its “data model” binding.

We either can Ctrl + right-click the field we want to check and then navigate to “Control Model XML” tab of Client Inspector to find its bindingExpression in “Value” tag.

Or, being in adaptation mode (anyway we will need the adaptation mode to create or change the UI rule), right-click the field we want to check.

This will open up the field’s details in adaptation panel on the right. Notice that we don’t need to go all the way from the top element of the screen drilling down to find the field. Since we’re in debugMode, the adaptation panel has a nice additional tab called “Details”. There under “Binding Information” we can find “Binding Expression”. In the example below, I’m checking item’s Processing type. As a bonus, we can even immediately see the code for the current value if the field is a type of dropdown box.

Either way, we have the “data model” binding.
The mentioned fields have the following:

  • Released to FSM = /Root/ServiceTermsReleaseToCoresystem
  • Order block = /Root/Account_SalesArrangement_OrderBlockingReasonCode
  • Item processing type = /Root/Item/UserServiceTransactionProcessingTypeCode

Now we need to navigate to the UI rules clicking up till we see “Implementation” (it is usually on UI Component level), then into it and then into “Rules and Validations”. And here we simply replace all slashes with dots in the found binding. Ok, except the first slash. This to be removed completely:
/Root/ServiceTermsReleaseToCoresystem ⇒ Root.ServiceTermsReleaseToCoresystem
/Root/Account_SalesArrangement_OrderBlockingReasonCode ⇒ Root.Account_SalesArrangement_OrderBlockingReasonCode
/Root/Item/UserServiceTransactionProcessingTypeCode ⇒ Root.Item.UserServiceTransactionProcessingTypeCode

And we’re ready to use them. Just paste the bindings with dots into UI Rules’ editor and check the value in the bottom section.

Released to FSM:

Order block:

Item processing type:

Happy ruling!