Dears colleagues, 

 

I want to show a message to users when Creatio is working on some process and hide it when the process ends, is there something similar to Toast dialogs/messages but to implement in a Freedom UI page?

 

I have also seen Ryan Farley's post (https://customerfx.com/article/displaying-toast-message-popups-from-cre…), but in both cases we need to specify a duration and I need the message to be visible until the process finishes. Sometimes it takes a few seconds and when there are more registrations, it could be several minutes and I want the user to know that Creatio is working ...

 

Thanks

Julio

Like 1

Like

5 comments
Best reply

We had a workaround to display the same toast message again but with a very short duration, since only 1 toast can display at a time, the new one replaces the original and then disappears. Not great and it would be nice to be able to hide toast messages on demand - ideally with reference to a specific message, so if we got back some ID from starting the toast notification.

You can also add a duration and awaitResponse to the request. Using awaitResponse will have it appear until acknowledged by the user.

request.$context.executeRequest({
    type: "crt.NotificationRequest",
    message: "This is my toast message!",
    awaitResponse: true
});

However, i don't believe there is anyway to have it display until you tell it to close (after the process completes)

thank Ryan,

 

I tried 

request.$context.executeRequest({
	type: "crt.NotificationRequest", 
	message: "Validando carga Excel...", 
	duration: 60000, 
	awaitResponse: true });

 

But in this case if the process ends before the 60seconds, need to user to close the message.... 

 

Is there another way to implement something similar?

 

Thanks again

Julio

We had a workaround to display the same toast message again but with a very short duration, since only 1 toast can display at a time, the new one replaces the original and then disappears. Not great and it would be nice to be able to hide toast messages on demand - ideally with reference to a specific message, so if we got back some ID from starting the toast notification.

Julio.Falcon_Nodos,

Harvey's idea could work, display the first toast with awaitResponse, then when the process ends display another toast without the awaitResponse and it should take the place of the first one.

Ryan

Harvey Adcock,

Thanks, great idea! I'll try it

Show all comments

Hi,

I often use backend validation in Creatio - I prevent saving a record and throw an exception from an event listener. It works like a charm, but as a result, the end user sees only a toast message, which is small and disappears after a moment, so it's easy to overlook. Is it possible to intercept such an error and display a normal confirmation popup, instead of this one?

It would be great if there is a generic solution, which doesn't require me to change all of my validations.

Like 0

Like

2 comments

Hi Eryk, in your business process you can display a mini page with the process component pre-configured page. 

 

Else you have following component to add in your site:

https://marketplace.creatio.com/template/popup-element-business-processes

 

Hope this helps.

Hello Eryk,
Thanks for your question.

As an alternative you can use websockets to implement your logic. 

Here i created a custom section and a clientMessageBridge as described in this article. In this section i created a Test Field. To subscribe to message broadcasting in the HandleViewModelInitRequest handler i used schema attribute to store a function that will be called whenever a message is published. Also note, that you should unsubscribe from websocket connection when your view is destroyed. To do this please don't forget to implement such logic in HandleViewModelDestroyRequest handler. 

On the form page when user clicks Save button a custom MyCustomRequest handler is called. In this handler i realized the following logic: call a business process (where i pass Test Field value as well as expected business process parameter value) -> if there is no validation error that is passed back from business process (hasValidationErrors property) i call SaveRecordRequest request -> if there is an error - the SaveRecordRequest is not performed.

Also the function that is triggered when a websocket message is broadcasted does open a pop-up which displays error message.

Here is an example:
page designer
handlers
bp

script task

And the outcome:
3
1

2

Hope this helps and let me know if you have any question left.

Show all comments

Hi, 

 

Please help, I need to notify final user some task he trigger is working.

 

For example, on a page, a user clicks on a button to do something, the button executes a process and I want to inform the client that it is processing what the process does.... 

 

Some ideas?

 

Thanks in advance

 

Kind regards

Julio

Like 0

Like

3 comments
Best reply

I do this often and it works great. You'd need to:

  1. Send a message from the process to the front end. See https://customerfx.com/article/how-to-refresh-a-page-from-a-process-in-…
  2. Have some code somewhere that listens for the message. See https://customerfx.com/article/receiving-server-side-messages-in-a-crea…
  3. Then display the toast message. See https://customerfx.com/article/displaying-toast-message-popups-from-cre…

 

I've typically done this by making a generic process I can use as a subprocess. It sends the message to the client. Then I make a generic script loaded from MainShell or MainHeaderSchema that listens for the message and displays the toast. It makes it simple and generic to use and works on any page.

 

Ryan

I do this often and it works great. You'd need to:

  1. Send a message from the process to the front end. See https://customerfx.com/article/how-to-refresh-a-page-from-a-process-in-…
  2. Have some code somewhere that listens for the message. See https://customerfx.com/article/receiving-server-side-messages-in-a-crea…
  3. Then display the toast message. See https://customerfx.com/article/displaying-toast-message-popups-from-cre…

 

I've typically done this by making a generic process I can use as a subprocess. It sends the message to the client. Then I make a generic script loaded from MainShell or MainHeaderSchema that listens for the message and displays the toast. It makes it simple and generic to use and works on any page.

 

Ryan

Ryan Farley,

 

How do you go about creating a generic script that loads in the MainShell or MainHeaderSchema in Freedom UI? It hasn't seemed to work when I've tried it.

Harvey Adcock,

You need to add a feature to enable creating replacing schemas for angular modules such as MainShell. See this thread: https://community.creatio.com/questions/how-create-replacing-schema-freedom-ui-basepagetemplate

Ryan

Show all comments