Question

Remove "Add link to knowledgebase" (attachments) menu item

Hello,

How do i remove the "Add link to knowledgebase" menu item on the tools menu of the Attachments detail?

 

Thank you,

Allen

File attachments
Like 0

Like

3 comments
Best reply

Hi Allen, 

 

Sure, there is an option to block such functionality. However, please note that the development process should be applied.

 

1. Firstly, you need to create a replacing client module schema for the "FileDetailV2" client module. Please find the information about it in the article by the link below:

 

https://academy.creatio.com/documents/technic-sdk/7-16/creating-custom-client-module-schema

 

2. In a new replacing client schema, please insert the code below:

 

define("FileDetailV2", [],
	function(ViewUtilities, ConfigurationConstants, ConfigurationEnums, RightUtilities, DefaultProfileHelper) {
	return {
		methods: {
			/**
			 * ########## ######## ########### ###### ############## ######.
			 * @return {Array} ######## ########### ###### ############## ######.
			 */
			generateButtonMenuItems: function() {
				let itemsConfig = this.callParent();
				const itemsConfigUpdated = (itemsConfig = []);
 
				return itemsConfigUpdated;
		},
	}};
});

3. Save the changes and hard-reload the page.

 

Regards,

Anastasiia

Hi Allen, 

 

Sure, there is an option to block such functionality. However, please note that the development process should be applied.

 

1. Firstly, you need to create a replacing client module schema for the "FileDetailV2" client module. Please find the information about it in the article by the link below:

 

https://academy.creatio.com/documents/technic-sdk/7-16/creating-custom-client-module-schema

 

2. In a new replacing client schema, please insert the code below:

 

define("FileDetailV2", [],
	function(ViewUtilities, ConfigurationConstants, ConfigurationEnums, RightUtilities, DefaultProfileHelper) {
	return {
		methods: {
			/**
			 * ########## ######## ########### ###### ############## ######.
			 * @return {Array} ######## ########### ###### ############## ######.
			 */
			generateButtonMenuItems: function() {
				let itemsConfig = this.callParent();
				const itemsConfigUpdated = (itemsConfig = []);
 
				return itemsConfigUpdated;
		},
	}};
});

3. Save the changes and hard-reload the page.

 

Regards,

Anastasiia

Anastasiia Markina,

 

Why would you still want to call the parent method? Wouldn't it make more sense to just re-write the method to just return an empty array? e.g.:

define("FileDetailV2", [],
	function() {
	return {
		methods: {
			/**
			 * ########## ######## ########### ###### ############## ######.
			 * @return {Array} ######## ########### ###### ############## ######.
			 */
			generateButtonMenuItems: function() {
				return [];
		},
	}};
});

 

Hi Harvey, 

 

Sure, such a solution is appropriate, too. However, it's always better to use this.callParent method to avoid any issues through future updates. 

 

Thus, this.callParent calls the parent method firstly instead of re-writing or breaking its logic, so this is a safer approach for a client module schema replacement.

 

Regards,

Anastasiia

Show all comments