Hello Community,

I am currently facing an issue with a model page that contains two lookup fields: one for contact and the other for email. My goal is to allow the user to select an email address associated with the selected contact, not just the primary email, but any email linked to that contact. To achieve this, I am using dynamic filtering for ContactCommunication to filter by the current contact and email communication type.

I’ve implemented this logic within the crt.LoadDataRequest handler because the email field is a simple dropdown and does not open a separate selection page.

The problem: 
When a contact is selected, I refresh the email list data source as expected. However, the email list is not properly reloading after a contact is deselected and reselected. In this case, the email filters do not update correctly. The issue is that the email list only reloads and applies the correct filters when I manually reselect the email field.

This behavior is causing a problem where the email dropdown is not correctly filtered based on the newly selected contact. Below is the code I am using for the handler:
 

handlers: /**SCHEMA_HANDLERS*/[
 {
   request: "crt.LoadDataRequest",
   handler: async (request, next) => {
     const emailDataSource = "UsrEntity_004572bDS_UsrEmailAddre_gzbqqxc_List_DS";
     const contactDataSource = "UsrEntity_004572bDS_UsrContact_7esmp6a_List_DS";

     if (request.dataSourceName === emailDataSource) {
       const lookupValue = await request.$context.UsrEntity_004572bDS_UsrContact_7esmp6a;
       console.log("Lookup Value:", lookupValue);

       if (lookupValue) {
         console.log("Filter Hit");
         const filter = new sdk.FilterGroup();
         filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "Contact", lookupValue.value);
         filter.addSchemaColumnFilterWithParameter(sdk.ComparisonType.Equal, "CommunicationType", "EE1C85C3-CFCB-DF11-9B2A-001D60E938C6");

         const newFilter = Object.assign({}, filter);
         newFilter.items = filter.items;
         console.log("Filter created");
         request.parameters.push({
           type: "filter",
           value: newFilter
         });
         console.log("Filter added to request");
       } else {
         console.log("Empty Lookup");
         // request.$context.UsrEntity_004572bDS_UsrEmailAddre_gzbqqxc = null;
         // request.$context.UsrEntity_004572bDS_UsrEmailAddre_gzbqqxc_List_DS = null;
       }
     }

     if (request.dataSourceName === contactDataSource) {
       console.log("Contact Selected, reloading email address list");
       // request.$context.UsrEntity_004572bDS_UsrEmailAddre_gzbqqxc = null;

       await request.$context.executeRequest({
         type: "crt.LoadDataRequest",
         $context: request.$context,
         config: { loadType: "reload", useLastLoadParameters: true },
         dataSourceName: emailDataSource
       });

       console.log("Email list reloaded successfully!");
     }

     return await next?.handle(request);
   }
 }
]/**SCHEMA_HANDLERS*/;
 

I would greatly appreciate it if you could look into this issue and suggest a solution.

Thank you!

Like 1

Like

1 comments

It is hard to tell what the issue is based on the code alone, in this situation, it would be better to run a proper debug to see what exactly went wrong. But, based on your description I can assume that there is something wrong with a refresh. Not with its code but rather with a place it is called. Try to use different approaches to it.

Show all comments

Hello Community, 

 

I have an editable detail with a field type as lookup, user can update the lookup. 

when user selects lookup value from the dropdown and click on save all button for the editable detail, a business process(the business process is designed to run the process for each item) gets triggered to calculate other fields in the record. 

when I do this for a single record I am able to see the changes with no issues, 

But when I update multiple records, I could not see the latest updates for all the records except for the one record. But when I do a refresh page, I am able to see the updated values.

I have  checked the option "Enable Live Data" for the detail object as well. 

Any suggestions are really helpful

 

Thanks

Gargeyi

 

Like 0

Like

1 comments

Hello,



I believe your business task could be achieved by using ''Refresh active page' process element for Creatio.

Show all comments

Hello Community, 

 

I wanted to refresh the detail in a form page after adding/updating a detail.

Here all the fields in the detail is added/updated in a separate page. On click of save button, the record gets added/updated. But I wanted to refresh entire detail.

 

Thanks

Like 0

Like

3 comments

Hello, 



Please check the discussion regarding your question here.

Bogdan,

Hello Bogdan, 

 

Thank you for your response.

But I wanted to reload the detail in Freedom UI, the detail is in the form page and on click of '+' we add the new details which is in other form

 

Once I save the details the page automatically moves the parent form page. But the detail is not refreshed, Only the record gets added to the detail.

 

I wanted to refresh entire detail after click of Save while saving a new record in child form.

 

const handlerChain = sdk.HandlerChainService.instance;

                             await handlerChain.process({

                            type: "crt.LoadDataRequest",

                            $context: request.$context,

                            config: {

                                loadType: "reload"

                            },

                            dataSourceName: "datasourcename"

                        });

 

This works in the current form page. But i wanted to refresh the detail in parent form page once I click on save button in child form page.

 

GargeyiGnanasekhar,

 

Unfortunately, we don't have ready examples of the implementation of your business task.

 

We've registered it in our R&D team backlog for consideration and implementation in future application releases.

 

Thank you for helping us to improve our product. 

Show all comments