Freedom UI send a record ID to another page

Hello. I'm trying to configure a button for Freedom UI that should open a page and pass a parameter (the ID of the page from which the button was clicked) to the new page. But none of the options I've found have worked. Maybe someone can help.

Here's what I'm trying to do:

When the button is clicked:

    handler: async (request, next) => {
      const recordId = await request.$context.Id;
      const handlerChain = sdk.HandlerChainService.instance;
      await handlerChain.process({
        type: "crt.OpenPageRequest",
        schemaName: "UsrAccountContactsForPortal_Minipage",
        $context: request.$context.Id,
      });

      return next?.handle(request);
    }

When the page is initialized:

	{
		request: "crt.HandleViewModelInitRequest",
		handler: async (request, next) => {
			const recordId = await request.$context.Id;
			console.log("Received Id:", recordId);
			return next?.handle(request);
		}
	}

Thank you.

Like 0

Like

1 comments

You can only pass default values (or really any values) to crt.CreateRecordRequest, not crt.OpenPageRequest. For that scenario, I've been using the browser's BroadcastChannel API to send it via messages to the opening page. You can see an example of that in the comments on this thread https://community.creatio.com/questions/open-custom-freedom-ui-page-custom-button-opportunity-edit-page-and-pass-opportunity

Ryan

Show all comments