Wednesday, March 15, 2017

It's never too late to Validate!

As you'll probably know every 3 months a new release of SAP Hybris Cloud for Customer is being pushed to all users, resulting in all system tenants being upgraded with new features, bug fixes and performance improvements. Also this time, Release 1702 contains several nice features which can be of great help to streamline your business processes. One of these new features is the Validation Editor. If the expression 'Garbage In, Garbage Out' sounds very familiar to you, this blog can be of great help to you. Because it's obvious that data pollution has a bad influence on the effectiveness and efficiency of your company.


Validation Editor


As of Release 1702 you are able as an Administrator to define field validations to generate custom messages. Of course you must define the conditions to trigger the validation and these can only be applied to the Master layout, which will work both in online and offline mode.

Now let's take a simple example to illustrate this feature of the Validation Editor.

Within our company it's only allowed to register Opportunities with an Expected Value exceeding an amount of 10.000,- to keep a profitable margin on sales. Now how can we ensure that the amount of Expected Value entered for an Opportunity will never be lower than 10.000,-?

First of all the following basic steps have to be taken:
  • Log on as Administrator to C4C in the HTML5 client;
  • Go to Adapt -> Edit Master layout;
  • Select the appropriate field; 
  • Click on the new triangular icon 'Add Validation' (1st icon from the left).

From this point on the real work starts and you're only 3 steps away from activating the validation rule....


Define a Validation Name

The first step is to create a new Validation Rule by entering a Validation Name and Description.
  • The Event cannot be chosen and is defaulted on 'onSave' by SAP.
  • Choose the Severity of the Validation check:
    • Error: The object (in our case an opportunity) can't be saved and user must correct the field entry.
    • Warning: The system will raise a warning when the conditions of the Validation Rule have not been met, but the transaction can be saved.
    • Information: The system will only inform you that the conditions of the Validation Rule have not been met.

In our example we want the system to raise an Error, because the amount entered for Expected Value may never be lower than 10.000,-!


Define Validation Rule

The second step to be taken is to create the Validation Editor Rule Name and the Conditions of the Validation Rule.
  • By clicking on the red marked icon, you will create a new Rule and you're able to enter a Rule Name. Also enter a Description for the newly created Validation Rule.
  • Select the Field Name that you want to use in the code for the Validation Rule. In this case, 'Expected Revenue Amount'.
  • Select the correct Operator or Function for the Rule. In our case we are using the Operator 'Less Than'. When the outcome of the condition is 'true' the message will be raised.
  • Enter a value. The minimum amount of Expected Value for our Opportunities: 10000.
As we can see in the screen shot below, the outcome at this moment is false. That's correct of course because the initial amount entered for the Opportunity is 20.000.


Define Validation Message

In this final step you're able to define the message that must be shown to the user when the outcome of the conditions for the Validation Rule is true.


Do not forget to activate the Validation check by clicking on the "Apply" button. Now the new rule has been created and saved. And you have to end the Master Layout changes of course!
From now on, each time an user is entering an Expected Value amount lower than 10.000, this error message will be raised upon saving.

Now let's check for our example if the Validition Editor is doing its job by editing the Expected Value amount of the Opportunity. I've changed the amount into 8.000 and want to save the Opportunity.

An error message is being raised and it's not possible to save the Opportunity until the amount exceeds the minimum amount of 10.000. The Validation Editor is working perfect!


To finalize this blog, I have summarized some of the most important aspects of the Validation Editor:
  • Rules can be defined by Administrators who have the authorization to adapt the Master layout.
  • Rules are only applied to the Master layout.
  • Validation Rules can be defined for standard SAP UI fields and KUT fields.
  • Validation Rules will only be executed at “on-save”.
  • Rules will apply both in online and offline mode.
  • It's possible to create Validation Rules based on existing Editor Rules.

Hopefully this blog has provided you enough insight to this powerful feature which can support your daily business process and also keep the 'garbage' out of your system!




3 comments:

  1. Hello,

    It's indeed very helpful, but I've noticed 2 limitations: I cannot add validations at item level and I cannot translate the error message.

    Have you tried them? Any luck on those?

    Many thanks

    ReplyDelete
    Replies
    1. Hello,

      Thank you for your feedback and remarks about the two limitations.
      Indeed it's not possible to add validations at item level, so far it's only working on header level. Maybe this will be a feature in the next release.
      And it seems that the possibility to have the message translated into other languages is not active yet, although the button 'Add Translation' suggests otherwise. I'll investigate this further and will keep you posted on this.

      Kind regards,
      Roderick Stoffels

      Delete
  2. This comment has been removed by the author.

    ReplyDelete