Hi,
I need to hide the remove button from a list view. (Espo crm 7.5.4)
I have a custom entity called IncidentsReportings which holds records of incidents (incident 1, incident 2, etc). Each incident report can be linked (One-to-Many relation) to accounts to see which customers were affected by the incidents.
The accounts are now listed at the bottom panel and I have options to "View, Edit, Unlist and Remove" (small arrow down button of each entry) and "Create, View list and Select"
I want at least to hide the "Remove" button, because this actually deletes an account entry when a user maybe only wants to unlist an entry. Mistakes can happen easily.
I tried to follow this guide: https://forum.espocrm.com/forum/deve...based-on-value
but had to change it a bit because I think there were mistakes in the example. Missing Brackets and a comma at the end of rowActonsView
This is the my code now.
1) client/custom/src/views/record/list.js
2) custom/Espo/Custom/Resources/metadata/clientDefs/IncidentReporting.json
This finally worked but only on the list with the records of all incidents. But I need to remove the button from the list of accounts inside each individual incident report.
What to I need to do? Add a custom view on field level: https://docs.espocrm.com/development...s/#field-views ?
So code snippet 2 would look like this?
custom/Espo/Custom/Resources/metadata/entityDefs/IncidentReporting.json
And what about snippet 1?
client/custom/src/views/account/incidentreporting/accounts.js ?
I need to hide the remove button from a list view. (Espo crm 7.5.4)
I have a custom entity called IncidentsReportings which holds records of incidents (incident 1, incident 2, etc). Each incident report can be linked (One-to-Many relation) to accounts to see which customers were affected by the incidents.
The accounts are now listed at the bottom panel and I have options to "View, Edit, Unlist and Remove" (small arrow down button of each entry) and "Create, View list and Select"
I want at least to hide the "Remove" button, because this actually deletes an account entry when a user maybe only wants to unlist an entry. Mistakes can happen easily.
I tried to follow this guide: https://forum.espocrm.com/forum/deve...based-on-value
but had to change it a bit because I think there were mistakes in the example. Missing Brackets and a comma at the end of rowActonsView
This is the my code now.
1) client/custom/src/views/record/list.js
Code:
define('custom:views/record/list', 'views/record/list', function (Dep) { return Dep.extend({ rowActionsView: 'views/record/row-actions/view-and-edit' }); });
2) custom/Espo/Custom/Resources/metadata/clientDefs/IncidentReporting.json
Code:
{ ... "recordViews": { "list" : "custom:views/record/list" } }
This finally worked but only on the list with the records of all incidents. But I need to remove the button from the list of accounts inside each individual incident report.
What to I need to do? Add a custom view on field level: https://docs.espocrm.com/development...s/#field-views ?
So code snippet 2 would look like this?
custom/Espo/Custom/Resources/metadata/entityDefs/IncidentReporting.json
Code:
{ "fields": { "accounts": { "view": "custom:views/incidentreporting/fields/accounts" } } }
client/custom/src/views/account/incidentreporting/accounts.js ?
Comment