Catch On Stage Change After Task Is Performed

Hello community,

 

I am using perform task inside section cases. The task updates the entity stage. After the stage is updated from the task I want to catch this event and reload the entity from the client side. I tried using the following approach but nothing happens

"Stage": {
				dependencies: [
					{
						columns: ["Stage"],
						methodName: "onChangeStage"
					}
				]
			}

The below script is called only when the stage is updated directly from the client side and not from a task or a business process. Is there a way to catch this event from the client side?

Like 0

Like

1 comments
Best reply

Since the automatic changing of a stage happens outside of the context of a page, you won't receive any events from the change on the page itself. 

The only option is to either use a process, entity subprocess or entity event listener class (and starts with a signal of case modified in stage field) and if it's changed to the appropriate stage you send a signal to the client. You can see how to send a message from the server (such as from a process) to the client here: https://customerfx.com/article/sending-a-message-from-server-side-c-to-…

You'll add code to the page to listen for this message and then reloadEntity to refresh the page. 

BTW, if you want to use an entity event listener class instead of a process, I've outlined how to do that here https://customerfx.com/article/adding-code-to-listen-for-entity-events-… although using a process is quick and easy.

Ryan

Since the automatic changing of a stage happens outside of the context of a page, you won't receive any events from the change on the page itself. 

The only option is to either use a process, entity subprocess or entity event listener class (and starts with a signal of case modified in stage field) and if it's changed to the appropriate stage you send a signal to the client. You can see how to send a message from the server (such as from a process) to the client here: https://customerfx.com/article/sending-a-message-from-server-side-c-to-…

You'll add code to the page to listen for this message and then reloadEntity to refresh the page. 

BTW, if you want to use an entity event listener class instead of a process, I've outlined how to do that here https://customerfx.com/article/adding-code-to-listen-for-entity-events-… although using a process is quick and easy.

Ryan

Show all comments