Each level of the object model has a Methods folder that contains the methods (actions) applicable to objects at that level. You can use the methods to write scripts.
The following procedure provides an example of associating a JavaScript script to a document. The script causes the SalesResults section (object) to activate (method) when the document Sample1.bqy is opened.
To create a script that activates the SalesResults section when Sample1.bqy is opened:
Select File, then Document Scripts.
Script Editor is displayed. OnStartup is selected by default in the Event Trigger drop-down list.
In the object browser, select Application , then ActiveDocument, then SalesResults, and then Methods.
Interactive Reporting or Interactive Reporting Web Client enters a script in the scripting pane and attaches it to the OnStartup event listed in the Event Trigger drop-down list.
Test the script by reopening the document.
When Sample1.bqy opens, the SalesResults section of the document is displayed by default.