You are here:
Automatic Vlocity State Transition Component Refresh
Use a PushTopic to automatically refresh the Vlocity State Transition component when the Status field of a record updates.
This task is optional and should only be completed if you use the Vlocity State Transaction component.
- Click the quick access menu (Setup gear icon), and click Developer Console.
- From the Debug menu, select Open Execute Anonymous Window.
-
In the Enter Apex Code window, paste in the following Apex code, and
replace the object and field names based on which object you want to update.
For example, to enable a PushTopic for the Quote State Transition component, the Apex code would look like this:
PushTopic pushTopic = new PushTopic(); pushTopic.Name = 'QuoteStateEvent'; pushTopic.Query = 'SELECT Id, Status FROM Quote'; pushTopic.ApiVersion = 51.0; pushTopic.NotifyForOperationUpdate = true; pushTopic.NotifyForFields = 'Referenced'; insert pushTopic;For the Claim Status State Transition component, it would look like this:
PushTopic pushTopic = new PushTopic(); pushTopic.Name = 'ClaimStateEvent'; pushTopic.Query = 'SELECT Id, Status FROM Claim'; pushTopic.ApiVersion = 51.0; pushTopic.NotifyForOperationUpdate = true; pushTopic.NotifyForFields = 'Referenced'; insert pushTopic; - Click Execute.

