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