Hi Team,

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").



How to achieve this kind of implementation?



Regards,

Adharsh S

Like 0

Like

5 comments
Best reply

Hi Adharsh,

 

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.

 

Best regards,

Oscar

Hi Adharsh,

 

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.

 

Best regards,

Oscar

Oscar Dylan,

Thanks for the reply.



One small change in the code,

Instead of , var rowId = options.rowId;

You can choose  var rowId = entityInfo.recordId;



Because, options.rowId returns "undefined".



Regards,

Adharsh S

Adharsh,

 

You are welcome.

 

This is strange, in my code options.rowId returned values and entityInfo was always undefined:

Maybe it behaves differently in different sections... Anyway, debugging will always provide a correct way to get the data needed:)

 

Best regards,

Oscar

Oscar Dylan,

 

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!



Regards,

Adharsh S

Oleg Drobina,



Could you please share how did you debug the client code using IDE.

Creatio doesn't have an article for the de-bugging the JS files in realtime using IDE. If you could share the steps it would be of great help.



BR,

Bhoobalan Palanivelu.

Show all comments

Hi,

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.

Can anyone explain to me why this happens?

 

Thanks!

Like 0

Like

2 comments

Hello Andreia,



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.  



Best regards,

Bogdan

Thanks, Bogdan.

Show all comments

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?

Like 0

Like

3 comments

Hello Julian, 

 

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.

 

Best regards, 

Anastasiia

Anastasiia Zhuravel,

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?

julian hatteea,

 

Hello, 

 

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. 

 

Best regards, 

Anastasiia

Show all comments

Hi All,

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 ?



Regards,

Adharsh S

 

Like 0

Like

4 comments

Hello Adharsh, 



Please change SchemaName back to UsrSchema******Detail and change the Parent schema back to FileDetailV2. Then compile the system. 

IF the issue persists, please contact us at support@creatio.com

Best regards,

Yurii

Hello Yurii Sokil,

 

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.







Regards,

Adharsh S

Adharsh,



Please contact us at support@creatio.com 

This situation need deeper analysis than we can provide on community. 

Yurii Sokil,

I'm also facing the same error in console while implementing using the above method.

Show all comments

Hi All,

 

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?



Regards,

Adharsh S

Like 0

Like

2 comments
Best reply

Hi Adharsh, 

 

In this case you can set up access rights, so only needed persons(e.g. Supervisor) will be able to see the items.

 

Please check the next post, it contains a very detailed instruction regarding how this functionality can be implemented:

 

https://community.creatio.com/articles/how-show-action-set-access-right…

 

Best Regards, 

 

Bogdan L.

Hi Adharsh, 

 

In this case you can set up access rights, so only needed persons(e.g. Supervisor) will be able to see the items.

 

Please check the next post, it contains a very detailed instruction regarding how this functionality can be implemented:

 

https://community.creatio.com/articles/how-show-action-set-access-right…

 

Best Regards, 

 

Bogdan L.

Bogdan Lesyk,



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. 



Is there any other way to achieve this use case?



Regards,

Adharsh S

Show all comments

Hi All,



I have a use-case as the user doesn't has access to redirect to the a new page on clicking of the hyperlink of the lookup field.







How to disable the Hyper-Link for the lookup field and show it as normal text?



Regards,

Adharsh S

Like 0

Like

1 comments

Hello Adharsh,

 

You can find the answer to your question in this Community post.

 

Best regards,

Bogdan S.

Show all comments

Hi All,

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 ?

 

Regards,

Adharsh S

Like 0

Like

6 comments

Hello Adharsh,

Something else must be going wrong. I just tested this and my filters do get applied to the virtual lookup for me. My code looks like this: 

"ContactLookup": {
	dataValueType: Terrasoft.DataValueType.LOOKUP,
	type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	caption: "Test",
	referenceSchemaName: "Contact",
	isSimpleLookup: true,
	lookupListConfig: {
		filters: [function() {
			var filters = Ext.create("Terrasoft.FilterGroup");
			filters.add("TestFilter", Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "Name", "Ryan Farley"));
			return filters;
		}]
	}
}

and the result is: 

Ryan

Hello Adrash,

 

We've also tested Ryan's code and it works. Please use the same approach on your side to complete the business task.

 

Best regards,

Oscar

Ryan Farley, Oscar Dylan,

 

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.



Regards,

Adharsh S

Adharsh,

 

You need to debug the logic and see if the filter is returned upon:

 

var filters = Ext.create("Terrasoft.FilterGroup");
			filters.add("TestFilter", Terrasoft.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "Name", "Ryan Farley"));
			return filters;

execution. Also check if there is no other logic is connected to the same column which may affect the filter.

 

Best regards,

Oscar

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".

Show all comments

Hi All,



We are facing an issue, flooded with WebSocket connection errors in console,







When we tried to ping the Server Channel it returns with an error,





Due to this, all our "Terrasoft.ServerChannel" items are not working.

How to resolve this issue? Any idea on this will be really helpful.



Regards and Thanks,

Adharsh S

Like 0

Like

2 comments
Best reply

Hello!

 

The error indicates that the WebSockets are not properly set up in your local environment. 

 

Please take a closer look at the Setup WebSockets Academy article that describes the process of setting up Creatio configuration files for the correct operation of websockets.

 

Please let us know in case any additional information is required. 

 

Best regards, 

Olga. 

Hello!

 

The error indicates that the WebSockets are not properly set up in your local environment. 

 

Please take a closer look at the Setup WebSockets Academy article that describes the process of setting up Creatio configuration files for the correct operation of websockets.

 

Please let us know in case any additional information is required. 

 

Best regards, 

Olga. 

Olga Avis,



Thanks, the issue is fixed.



Regards,

Adharsh S

Show all comments

Hi All,



By default in the Calendar section page, it shows only one button "Task" which maps to the edit page of Activity Type - "Task" :







I have added a new edit page of Activity type "Schedule" and overridden the Button Diff to change the caption.



As a result of this, it shows all the edit pages in the Test button DropDown as you can find in the below image. The above code returns all the editPage when count greater than 1.







How to map the "Schedule" edit page button to the Test and remove all the other buttons and the dropdown feature. Similar to how by default "Task" edit page button gets mapped to Task button.



Kindly help me how to implemet this.



Regards and Thanks,

Adharsh S

Like 0

Like

4 comments

Hi Adharsh, 



We  checked your problem and came up with the following solutions: 



1. You may turn off 'Values of the type Lookup' that you don't want to use in your drop-down menu. In this way you'll get just one button to choose. But please be careful because all you previous activities will be shown due to the page that is opened upon clicking on the chosen button. (In your case - Schedule).

 







2. The second way you can implement it using code (in case option 1 was applied all the changes from option 1 should be reverted before applying the next code): 



Bellow you may find the example: 

 define("ActivitySectionV2", [], function() {

  return {

    entitySchemaName: "Activity",

    details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,

    diff: /**SCHEMA_DIFF*/[

      {

                    "operation": "merge",

                    "name": "SeparateModeAddRecordButton",

                    "parentName": "SeparateModeActionButtonsLeftContainer",

                    "propertyName": "items",

                    "values": {

                        "controlConfig": {

                            "menu": {

                                "items": {

                                    "bindTo": "EnabledEditPages",

                                    "bindConfig": {

                                        "converter": function(editPages) {

                                            if (editPages.getCount() > 1) {

        // Add some condition here

        // Add filter to display only specific pages

        var result = editPages.filter(function(page) {

            return page.get("SchemaName") === "UsrActivity1Page"; // Display only activities

        });

        return result;

    } else {

        return null;

    }

                            

                                        }

                                    }

                                }

                            }

                        }

                    }    

                },

    ]/**SCHEMA_DIFF*/,

    methods: {}

  };

});



P.S. 

 



In this case you still have a little drop down menu (with one option): UsrActivity1Page - the object page that will be displayed. In this case all your activities remain the same. 



Hopefully it will help you! 



Best Regards, 



Bogdan L

Bogdan Lesyk,



The above code is really helpful.

As you mentioned a little drop-down menu with one option is shown.



But the use case is to show only one button("NEW TASK") similar to what we have in OOTB which is mapped to the Activity Type - "TASK".



Even though we are adding a new edit page, I don't want to have a separate button for it.



I just need to show the OOTB button "NEW TASK" and ignore all others, similar to what you see in the below image.







It will be really helpful, as how to implement this.



Regards and Thanks,

Adharsh S

Adharsh,

 

Then you need to use the first option Bogdan proposed and also override the initAddRecordButtonParameters method on the ActivitySectionV2:

 

initAddRecordButtonParameters: function() {
				var caption = this.get("Resources.Strings.AddRecordButtonCaption");
              	this.set("AddRecordButtonCaption", caption);
            }

And specify "New task" as a value of the "AddRecordButtonCaption" localizable string in the ActivitySectionV2.

 

Best regards,

Oscar

Oscar Dylan,



We are using two EditPages one is OOTB - "Activity Type - TASK" which is used to create tasks through UI. That's where we need the OOTB button with activity type as "TASK".

Apart from this, we are creating a new custom edit page for Another Activity Type. We don't need to show the button in UI.



If we follow the first option proposed by Bogdon, the business case will get failed.



I need to use both edit pages in the Activity section. But it's enough to show only the OOTB button ("NEW TASK").



Is there a way to implement this.



Regards and Thanks,

Adharsh S

Show all comments

Hi All,

 

We found that sometimes the filters are not showing up on the Calendar page when we switch between the sections. We could see a blank space in the filter area and throws a few errors on the base page.







As you can see in the above image, the filters are hidden.



Error in console,







This is an intermintent issue. Repo rate - 2/5. couldn't able to find the root cause for it as it throws error in the base page.



Any thoughts on this will be a great help.



Regards and Thanks,

Adharsh S

Like 0

Like

0 comments
Show all comments