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

In my Lookup it must show only those contacts who have Specific role.

Example:

Contact-1 , Contact-2 are present

Contact-1 Have Role-1 and contact-2 will have Role-2

Lookup must show only Contacts with Role-1 . 

If not possible Can we have workaround for this .

 

In my Example it will show all contacts who are system users.

for these i want to filter collection based on role.

I tried this Please let me know the changes needed.

"lookupListConfig": {

                    // Array of filters used for the query that forms the lookup field data.

                    "filters": [

                        function() {

                            var filterGroup = Ext.create("Terrasoft.FilterGroup");

                            // Adding the "IsUser" filter to the resulting filters collection.

                            // The filter provides for the selection of all records in the Contact core schema

                            // to which the Id column from the SysAdminUnit schema is connected, for which

                            // Id is not equal to null.

                            filterGroup.add("IsUser",

                                Terrasoft.createColumnIsNotNullFilter("[SysAdminUnit:Contact].Id"));

                                                        // Adding the "IsActive" filter to the resultant filters collection.

                            // The filter provides for the selection of all records from the core schema.

                            // Contact to which the Id column from the SysAdminUnit schema, for which

                            // Active=true, is connected.

                            filterGroup.add("IsActive",

                                Terrasoft.createColumnFilterWithParameter(

                                    Terrasoft.ComparisonType.EQUAL,

                                    "[SysAdminUnit:Contact].Active",

                                    true));

                            return filterGroup;

                        }

                    ]

                }

            }

Like 0

Like

1 comments

Dear Sushma,

In order to check whether a contact has particular role you need to create a query to the SysAdminUnitInRole table. Basically setting up the filter to check whether current user has the needed role in SysAdminUnitInRole table.

Please modify your filter settings to read from correct table. Also, please see the article below, which describes how to create queries to the database. (particularly Definition of root schema. Creation of paths to columns against root schema. Examples.)

https://academy.bpmonline.com/documents/technic-sdk/7-13/use-entitysche…

Regards,

Anastasia

Show all comments