My task is to hide the OPEN, DELETE, and COPY buttons(which is shown after selecting a record) for specific users like it should be hidden for all users except System admin.
I need to hide the Export to Excel option for Details present on the record edit page for all users except for Specific users like Supervisor.
However I have asked this question earlier and Ryan has replied to that and that works fine as well. But now the situation is that this is to be done for specific users.
To hide for specific users only, you can add something like the following to the detail schema's methods:
getExportToExcelMenuVisibility: function(){// first make sure it's not already hidden due to operation permissions
var baseVisible =this.callParent(arguments);if(!baseVisible){returnfalse;}// now you can return true or false to show/hide for current userreturntrue;// or return false to hide for the current user},
getDataImportMenuItemVisible: function(){// first make sure it's not already hidden due to operation permissions
var baseVisible =this.mixins.FileImportMixin.getDataImportMenuItemVisible.apply(this, arguments);if(!baseVisible){returnfalse;}// now you can return true or false to show/hide for current userreturntrue;// or return false to hide for the current user}
However, note, only go this route with code if you need to limit this capability in this specific detail only. If you're wanting to remove this from everywhere in the app, then using the operation permission as Julio mentioned in your other post is the right approach.
Please note that debugger and console.log are not needed here, they were added just for testing the code.
As you can see the key actions here are:
- calling RightUtilities and checking if the user has operation permission rights for "CanExportDataOnCustomDetail" operation (the one that we've created at step 1)
- setting the "CanExportDataOnCustomDetailAtt" attribute value based on the RightUtilities check in the checkOperationPermission function
- using the "CanExportDataOnCustomDetailAtt" attribute value so to call getExportToExcelMenuVisibility method correctly due to our business task
As a result once the system user or role is added to the operation permission they will be able to see the "Export to Excel" button in the detail actions.
I need to hide the Export to Excel option for Details present in record edit page.
Like in the above screenshot, Previous PO/WO for the selected Project Details There is and option for Export to Excel & Data Import which I need to hide.
Also, in this case, you can go to "Operation Permissions" and restrict the export functionality to specific roles, see "CanExportGrid" Operation permission.
@Akshit, to avoid import, you need to edit "CanImportFromExcel" Operation Permission and configure the roles who must have permissions to import, by default just System Administrators
But one more question I need to hide these options only for specific users, say for all the users except Supervisor these Export to Excel option should not be visible.
FYI you are filtering the "CanImportFromExcel" and "CanExportGrid" Operation Permission by Name column rather than it should filter by Code column. Please find the below screenshot for more information.
First, I believe that the response includes response.errorInfo which you can check for any error messages. Second, if you look in the browser dev tools in the network tab, you should see the request there and you can look at the response to see if any messages provide any insight as to what is happening (as well as any errors in the console). Start there to see if there is any indication of what is going wrong. Nothing sticks out as incorrect in the code at first glance.
Please review Ryan's reply above and debug the code firstly. Please check if specific requests sent in the network tab return any errors and also check for the result from the debugger.
I have a use case to display a field containing values updating dynamically by querying the data from another table. And display the data in the calendar section page container similar to setup up the summary calculation.
Similar to the below image which shows total number of products and total cost in order page.
I need to implement this functionality in the calendar section page by calculating the value from another table (say, any integer field in Contact section).
You need to add label control element to "SeparateModeActionButtonsRightContainer" container in ActivitySectionV2 and define logic to calculate its value.
When I tried with "SeparateModeActionButtonsRightContainer" .
Since I have more buttons in that container, it getting overflowed. I need to create this label near the Tag in the filterContainer. When I tried to add in the "FiltersContainer". Its getting hidden as shown below. Can you help me with it, by showing the label in the filtercontainer?
It seems that your issue is that you are trying to occupy the space already reserved for the out-of-the-box filter module, so your fields are pushed out of its container. Please read my message here about this block:
You can use the same strategy, but, as I've mentioned in my message, Creatio R&D team highly disrecommend our clients affecting this part of the system somehow.
Instead, you can easily set your fields under the filter container. Here is the code example of how you can do it:
Is there a custom HTML control in Creatio that I can use to build a tree hierarchy and visualize it in the UI? The input parameter to the control will be a single node that could be at any position in the tree. The logic should query the database for the links to traverse upwards and downwards from the said node to complete the tree.
Is there already a control in Creatio that can be repurposed for this use-case?
Here is an example of the code that has perfectly worked on my end:
Terrasoft.sdk.Model.addBusinessRule("Case", {
name:"Make UsrStringField column required",
ruleType: Terrasoft.RuleTypes.Custom,
triggeredByColumns:["UsrBoolAct"],
events:[Terrasoft.BusinessRuleEvents.ValueChanged, Terrasoft.BusinessRuleEvents.Save],
executeFn: function(record, rule, column, customData, callbackConfig){
var isRequired;
var isActivated = record.get("UsrBoolAct");if(isActivated===true){
isRequired=false;}else{
isRequired=true;}
record.changeProperty("UsrStringField", {
isValid:{
value: isRequired,
message:"Column must be filled in"}});
Ext.callback(callbackConfig.success, callbackConfig.scope, [isRequired]);}});
The logic here is that the "UsrBoolAct" column is true (this is a boolean column) then the "UsrStringField" should be filled in. After the application pool was restarted this output was received:
Please also note that wen workig with lookups instead of booleans such a construction will help to achieve the result needed:
var type = record.get("Type");if(type &&(type.get("Id")=== Terrasoft.ContactTypes.Doctor||
type.get("Id")=== Terrasoft.ContactTypes.ContactPerson))
Please restart the application pool in IIS if this is an on-site solution or contact us at support@creatio.com if this is a cloud app. Also please try to flush the web browser cache and cookies.
Also, what is the behavior when you log in as the user mentioned in the code?