Question

Remove new and Import buttons from a lookup object.

Hi,

I need to hide/remove the New button and the "Data Import" option available under Actions in a lookup object.

Like 0

Like

5 comments

Hello Janhav,

 

The best way to achieve your business task is disallow the import and export operation permission for users.

 

Best regards,

Bogdan

Hi Bogdan,

I need to restrict import for only few specific lookup objects and not for all objects.

I see the operation permission restricts for all objects.

Janhavi Tanna,

 

Please feel free to check the similar Creatio Community post, where discussed your question:



https://community.creatio.com/questions/how-hide-or-remove-actions-sect…



Best regards,

Bogdan

Bogdan,

I'm unable to find the page for lookup objects in which the above mentioned code can be executed.

Janhavi Tanna,



Please check methods in the BaseLookupConfigurationSection schema.

 

In order to hide the specific action, you will need to change a Visible property:
 
getSectionActions: function() {
                var actionMenuItems = this.callParent(arguments);
                actionMenuItems.each(function(item) {
                    if(item.values.Caption.bindTo === "Resources.Strings.ExportListToExcelFileButtonCaption"){
                        item.values.Visible = false;
                    }
                });
                return actionMenuItems;
            }
In order to remove the specific action from the collection:
 
getSectionActions: function() {
                var actionMenuItems = this.callParent(arguments);
                var itemToRemove;
                actionMenuItems.each(function(item) {
                    if(item.values.Caption.bindTo === "Resources.Strings.ExportListToExcelFileButtonCaption"){
                        itemToRemove = item;
                    }
                });
                actionMenuItems.remove(itemToRemove);
                return actionMenuItems;
            }





BR,

Bhoobalan Palanivelu.

Show all comments