How do we know if we should use helpers.navigate.to vs api.emit method in UI builder client scripts?

Kopresh
Tera Contributor

I have button component on a page and want to navigate to another page with some payload when a button is clicked. When i see the OOB apps, some use api.emit and some use helpers.navigate.to methods. How do i know which one to use? 

Also, where can i find information on creating handled events/dispatch events etc.?

 

1 REPLY 1

Marc Mouries
ServiceNow Employee
ServiceNow Employee

The helpers.navigate.to function is one among many shortcuts that the helpers API provides. If one helpers function performs what you need you're all set. 

You can find more information on the Developer API reference page: https://developer.servicenow.com/dev.do#!/reference/api/sandiego/client/helpersAPI