Filter Emails address in Section Actions Dashboard

Hello everyone. Can someone tell me how to filter the list of emails address via Account? That is displayed when registering email sending activity via the Section Actions toolbar. Found a similar article https://community.creatio.com/questions/filter-contact-list-section-act….  Thanks!

Like 0

Like

3 comments

Hello Serhii,
Thank you for your question.

I have tried to use a similar approach to the one mentioned in the forum discussion. Here is an example of how to filter recipients to contain 'mycompany' in the email address in the action dashboard of the contacts section.


define("EmailMessagePublisherPage", ["LookupUtilities"],
       function(LookupUtilities) {
           return {
               entitySchemaName: "Activity",
               mixins: {},
               attributes: {},
               methods: {
                updateLookupFilter: function(lookup) {
                  lookup.config.updateViewModel = function() {
                    this.pushSelectFilters = function(select) {
                      const filters = select.filters;
                      const lookupInfo = this.getLookupInfo();
                      if (!lookupInfo.columnValue) {
                        const searchColumn = this.get("searchColumn");
                        if (searchColumn) {
                          const columnPath = searchColumn.value;
                          const stringComparisonType = this.getStringColumnComparisonType();   
                          const filter = select.createColumnFilterWithParameter(stringComparisonType, columnPath,
"mycompany");
                          filters.add("searchDataFilter", filter);
                        }
                      } else {
                        lookupInfo.columnValue = null;
                      }
                    }
                  };
                },
                openRecepientLookupEmail: function() {
                  var lookup = this.getLookupConfig("Recepient");
                  
                    this.updateLookupFilter(lookup);
                  
                  lookup.config.actionsButtonVisible = false;
                  var searchValue = this.get("RecepientLookupSearchValue");
                  if (searchValue) {
                    lookup.config.searchValue = searchValue;
                  }
                  LookupUtilities.Open(this.sandbox, lookup.config, lookup.callback, this, null, false, false);
                },
              },
               diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
           };
       });

Hope this helps!

Hello. Thank you. The solution works, but it is not ideal. It is necessary to check the Account domain, or there may be employees who have a Gmail email. I am looking for another solution.

Hello Serhii,

The example I provided serves as a foundation for adding email address filtering for the action dashboard. You can use this example as a base and modify the filtering logic according to your preferences.

Hope this helps

Show all comments