Capture Close page event on FreedomUI

Hello Community,
Here is the scenario Im truing to solve.

We Have Opportunity (parent page) in freedomUI and Contact In Opportunity in Classic UI.

We want to capture the following event. When we click Close in 'Contact in opportunity', we want to capture this event, in the Opportunity Form Page. 

The scope behind this is to perform a list reload of the Contacts(have already tried Enable live update in the entities-doesnt work)

How can this be achieved?

Sasor

Like 0

Like

2 comments

++++

Hello,
 

You can implement the following code to reload the data source when you get to the Freedom UI page on the crt.HandleViewModelInitRequest.
 

Sample implementation for “Opportunities_FormPage”

define("Opportunities_FormPage", /**SCHEMA_DEPS*/["@creatio-devkit/common"]/**SCHEMA_DEPS*/, function/**SCHEMA_ARGS*/(sdk)/**SCHEMA_ARGS*/ {
...
        handlers: /**SCHEMA_HANDLERS*/[
              {
        // Load data grids
      request: 'crt.HandleViewModelInitRequest',
      handler: async (request, next) => {
          console.log("You returned to FreedomUI page");
            const result = await next?.handle(request);
            const handlerChain = sdk.HandlerChainService.instance;
            await handlerChain.process({
                type: 'crt.LoadDataRequest',
                $context: request.$context,
                config: {
                    loadType: "reload"
                },
                dataSourceName: "ContactRolesListDS"
            });
            return result;
      }
  }

Show all comments