Is there any way I can access a button instance directly, e.g., in the 'click' method of a client module in order to set the colour of the button using the setStyle method of the button object?
Not sure if it's possible since setStyle only receives some value as an argument and is being executed when the button is initialized.
In your case I would recommend to add this code to the click handler:
var buttonElementToModify = document.getElementById("ContactPageV2ChangeContainerStateButtonButton-textEl");
buttonElementToModify.style.backgroundColor="Green";
and replace ContactPageV2ChangeContainerStateButtonButton-textEl with an actual id of the element in DOM:
As a result when the button is clicked its color will be changed to green.
This element will generate the code itself and you don't need to change the Schema manually, which will be much complicated and could potentially affect the whole page.
We have a business use-case like enabling the MiniPage (View Mode) in the activity section based on conditions. I have enabled the view mode of the MiniPage, now I am able to see the mini page for all the records. But I need to show it for the records based on some conditions like (Eg: Title = "Appointment").
The logic below will make a mini page in view mode not appear on the page in case the title of the activity contains the "Visit" word.
Create a replacing view model for the ActivitySectionV2 and add the following code there:
define("ActivitySectionV2", [],
function(){return{
entitySchemaName:"Activity",
attributes:{"ResultGridSet":{"dataValueType":this.Terrasoft.DataValueType.TEXT,
"type":this.Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
"value":""}},
mixins:{},
methods:{
onGridDataLoaded: function(response){this.callParent(arguments);
var subjectsToExclude ="";
Terrasoft.each(response.collection.getItems(),function(item){
var activityTitle = item.values.Title;
var activityId = item.values.Id;if(activityTitle.indexOf("Visit")!=-1){
subjectsToExclude = subjectsToExclude + activityId +",";}});
subjectsToExclude = subjectsToExclude.substring(0, subjectsToExclude.length-1);this.set("ResultGridSet", subjectsToExclude);},
prepareMiniPageOpenParameters: function(options, entityInfo){
var rowId = options.rowId;
var gridSet =this.get("ResultGridSet");if(gridSet.indexOf(rowId)!=-1){return;}this.callParent(arguments);}},
diff:/**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/};});
The logic is simple:
1) onGridDataLoaded method is always called when the grid is loaded in the section. It contains the response argument which contains actual data that is stored in the grid (and we can use it).
2) Once onGridDataLoaded is called we take the response and check if the activity title contains the "Visit" word and perform this check for each item in the grid. If the activity title contains the "Visit" word we take an Id value for this activity and add it to the string subjectsToExclude parameter.
3) subjectsToExclude parameter result will be then passed to the ResultGridSet attribute that will be then used inside the prepareMiniPageOpenParameters method.
4) prepareMiniPageOpenParameters method is the method from base MiniPageUtilities mixin and we need to override its logic in the Activities section. prepareMiniPageOpenParameters has the options argument that is primary data regarding the activity on which the mouseover event was called. We can get the activity id from the options argument and use it further.
5) Inside the prepareMiniPageOpenParameters method we get the ResultGridSet attribute value and then check if the Id that was received from options can be found inside the ResultGridSet string. If it can be found the prepareMiniPageOpenParameters does nothing (and as a result the minipage is not opened), else - perform the parent method execution.
Feel free to create your own logic based on this example.
The logic below will make a mini page in view mode not appear on the page in case the title of the activity contains the "Visit" word.
Create a replacing view model for the ActivitySectionV2 and add the following code there:
define("ActivitySectionV2", [],
function(){return{
entitySchemaName:"Activity",
attributes:{"ResultGridSet":{"dataValueType":this.Terrasoft.DataValueType.TEXT,
"type":this.Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
"value":""}},
mixins:{},
methods:{
onGridDataLoaded: function(response){this.callParent(arguments);
var subjectsToExclude ="";
Terrasoft.each(response.collection.getItems(),function(item){
var activityTitle = item.values.Title;
var activityId = item.values.Id;if(activityTitle.indexOf("Visit")!=-1){
subjectsToExclude = subjectsToExclude + activityId +",";}});
subjectsToExclude = subjectsToExclude.substring(0, subjectsToExclude.length-1);this.set("ResultGridSet", subjectsToExclude);},
prepareMiniPageOpenParameters: function(options, entityInfo){
var rowId = options.rowId;
var gridSet =this.get("ResultGridSet");if(gridSet.indexOf(rowId)!=-1){return;}this.callParent(arguments);}},
diff:/**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/};});
The logic is simple:
1) onGridDataLoaded method is always called when the grid is loaded in the section. It contains the response argument which contains actual data that is stored in the grid (and we can use it).
2) Once onGridDataLoaded is called we take the response and check if the activity title contains the "Visit" word and perform this check for each item in the grid. If the activity title contains the "Visit" word we take an Id value for this activity and add it to the string subjectsToExclude parameter.
3) subjectsToExclude parameter result will be then passed to the ResultGridSet attribute that will be then used inside the prepareMiniPageOpenParameters method.
4) prepareMiniPageOpenParameters method is the method from base MiniPageUtilities mixin and we need to override its logic in the Activities section. prepareMiniPageOpenParameters has the options argument that is primary data regarding the activity on which the mouseover event was called. We can get the activity id from the options argument and use it further.
5) Inside the prepareMiniPageOpenParameters method we get the ResultGridSet attribute value and then check if the Id that was received from options can be found inside the ResultGridSet string. If it can be found the prepareMiniPageOpenParameters does nothing (and as a result the minipage is not opened), else - perform the parent method execution.
Feel free to create your own logic based on this example.
It is interesting. Might be it behaves differently in different sections. But I see your screenshot, you have debugged in the ActivitySection right. I have implemented the functionality on the same schema page. It seems to be weird behaving different across instances!
I have an "Anúncios" lookup. I want to create a new record from the lookup, but in the "Anúncios" lookup, the record is created but the relationship is not.
Unfortunately, it can't be configured automatically.
So, after creating a new record from the lookup you have to configure the relationship manually,
As a workaround, you can create a new business process to achieve your business task,
We have already registered the idea for our R&D team to implement this functionality in further releases. I will assign your case to this project in order to increase its priority.
When trying to initiate a new WhatsApp chat with a customer, more than 24 hours after the last message on the past chat, we get the alert: "Unable to send the message, the conversation ended more than 24 hours ago"
How can we bypass this to send an verified and approved HSM message to the customer?
The error message indicates that more than 24 hours passed after the last incoming message and prevents you from initiating the chat once again from your side, such limitation is done in order to prevent Spam messages (so your messages sent after 24 hours from last incoming message won't be delivered to a client).
However, you will be able to continue the same chat with no error message once there is a new incoming message from a client.
WhatsApp allows sending of pre-approved HSM messages after 24 hrs. We have seen that if we (manually) reopen the chat and send a correctly pre-approved HSM message, this is successfully sent even after 24 hrs. Is this the correct/supported method of sending approved HSM messages in Creatio, or should we send some method?
We have double-checked this information and so far, this functionality is not implemented in our system. We have already registered the corresponding query for our R&D team and will be waiting for implementation of pre-approved HSM messages functionality in the upcoming versions.
Thank you for helping us to make our Application better.
I have a use case to create an attachment detail using the custom object in the Pre-Config page. I have created a object having Parent Object as (File).
I have created a detail inside the preconfig Page,
But I couldn't see the detail as attachment in UI rather I could see it as an normal detail,
I have updated the parent page of the Detail schema to FileDetailV2, Even though I am unable to see the attachment changes in UI.
So, I have changed the entity schema name directly in the code as "FileDetailV2",
Now I am able to see the attachment in UI. But having error in the console. This error comes on opening of the page as well as trying to delete any attachment.
Also, In the designed it shows the detial as Unregistered as shown below.
Could anyone help where I have went wrong, how to resolve this issue and create a attachment detail with custom object ?
I have made the changes and compiled my instance. Post that I could see the detail as an attachment. But still, I could face the error in the console on the opening of the pre-configured page and deletion of records too.
The use case is to remove OOTB items/buttons from the action menu in Section edit page depending on the user roles such as, (Follow the Feed, Setup Access rights etc..)
There are example codes to add a new item to the action menu, as shown below,
How to remove an existing item from the action menu. Is there a way to achieve it?
I am able to hide the "Setup Access Rights" based on roles by referring the document.
Similar to that when I tried to hide the "Follow the feed" based on roles. In the base I could find only the "Enable" property for the button. So I have overridden that method as below and it got disabled based on roles,
getChangeUserSubscriptionIsEnabled: function() {
return this.get("CanManageAccessRight");
}
But the requirement is to hide the button based on Roles. I also tried to override this method "getEsnTabVisible" but I am still able too see the Follow the feed button in UI.
How to add filter to the virtual Lookups, I had added virtual lookup for contact entityschema. And when I tried to add filter to that, its not filtering out the data.
I have attached my code for the reference,
After adding the filter I am able to see all the values in the Lookup.
Is there a way, to Filter the Lookup values in Virtual lookup column ?
I have even tried with your code also, But I still find the same result. There is no error in console too. I am not sure what is been missed.
The only difference I could see is that I have implemented this virtual lookup in the Detail schema page and you have done this is Edit Page of a section.
Will this make any difference it Filtering the records? Ideally it shouldn't do such way.
This is an old thread, but I wanted to renew the conversation. I'm having the same issue. I've filtered lookups many times this way with no issue.
I have a modal page that inherits from BaseEntityPage. There is a virtual lookup on the page. With isSimpleLookup = true, the lookup won't reference lookupListConfig at all. It just ignores it. If I change isSimpleLookup = false, it will reference lookupListConfig and fire the code for filter. My problem is that since my module is already in a modal window, the lookup cant render as a modal also. I must use a simple lookup. I can filter simple lookups on other modules, but not this one. There must be something different about how the module is being rendered.
Any thoughts on how to get the simple lookup to filter here, or be able to use a modal lookup on another modal page?
More on this. So it looks like this is an issue inheriting from BaseEntityPage. I changed my modal module to inherit from BasePageV2 and now it works. Not sure if this is expected and I'm not sure what other issues I'll face using BasePageV2, as this is "base card schema".