Trigger script when the tab is clicked in a form

Aditya Prasad
Tera Contributor

Hello Everyone, 

 

I have added a new section(tab) in Incident form. This section has a ui macro which loads more information by making REST api calls on load event(ui macro onload javascript). 

The sections are loaded as soon as the incident form is loaded. 

My requirement is, I want to call these APIs only when user clicks on this section.

So is there any script which I can run when the tab becomes active?

 

Thanks

1 ACCEPTED SOLUTION

Pleasure! 

We had similar requirement long back and convinced customer to go with simpler alternative 🙂 

You can mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards

View solution in original post

7 REPLIES 7

Pleasure! 

We had similar requirement long back and convinced customer to go with simpler alternative 🙂 

You can mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!

Best Regards

Ankur Bawiskar
Tera Patron
Tera Patron

@Aditya Prasad 

Using DOM it might be possible but it's not recommended.

You can have some checkbox within the UI macro and based on that when it's checked the API calls will run and show the data.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Aditya Prasad 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader