Question

Hide a detail for a specific user

Dear All,

I am trying to hide a detail for a particular user. I tried to set up the business rules for that detail trhough Detail setup but it didn't work as expected. The business rules in detail setup can be set up only for the fields not for the detail as such. Example Scenario - Trying to hide 'Activity' detail for the Sales Person. Any ideas will be highly appreaciated.

Like

2 comments

Hello,

As an example, you can check the detail that gets hidden following some conditions – it is Email detail on the ContactPageV2.

Visibility of the detail is defined by this code:

{
                "operation": "insert",
                "parentName": "HistoryTab",
                "propertyName": "items",
                "name": "EmailDetailV2",
                "values": {
                                "itemType": Terrasoft.ViewItemType.DETAIL,
                                "visible": {"bindTo": " IsMyDetailVisible"}
                }
}

The value IsMyDetailVisible is set on this page but in your case it is not enough to configure it here because you need to hide a detail for the user (it is defined in SysAdminUnitInRole system table which cannot be reached through ESQ).

You need to create an operation in the system with the code CanReadMyCustomDetail (the operation code is arbitrary).

Then define the following permissions for this operation:

• A role that should not be able to see the entry is prohibited, position 0

• All company employees - allowed, position - 1

Check the value of this operation when the page loads redefining the method onEntityInitialized:

onEntityInitialized: function() {
                this.callParent(arguments);
RightUtilities.checkCanExecuteOperation({operation: " CanReadMyCustomDetail"}, /*Check the right to the system operation CanReadMyCustomDetail*/
                                function(result) {
                                                this.set("IsMyDetailVisible", !!result); /* Set the value of the parameter that is responsible for the visibility of the detail * /
                 }, this);
}

As a result, if the implementation is correct, the system operation CanReadMyCustomDetail will be called. If the user enters the "forbidden" role, then the IsMyDetailVisible parameter will be false and the item will not be displayed.

Regards,

Helen

This feature is implemented in Creatio 7.16.3 release via business rules

Show all comments