Using Javascript API from embedded web application

There are many useful things available inside of the javascript API (https://www.dundas.com/support/developer/script-library/ and https://www.dundas.com/support/api-docs/js/) but all of the examples I have seen use the script editor. Is it possible to either:

  1. Call these scripts from a web page which has Dundas embedded into it?
  2. Write scripts in a script editor / javascript override file and call them from the front end?

Thank you for your responses!

Call these scripts from a web page which has Dundas embedded into it?

This can be accomplished in two ways (both will require CORS to be configured):

  1. using the embed library, there is a run script method:

https://www.dundas.com/support/developer/samples/integration/using-the-dundas-bi-embed-library

  1. Post a message to the frame:

https://www.dundas.com/support/developer/samples/integration/using-cross-origin-resource-sharing-in-dundas-bi

Write scripts in a script editor / javascript override file and call them from the front end?

Yes however the context in which the script will execute will change as you won’t be inside a script action. How you get services will change in this case:

// Get file system service.
var fileSystemService = dundas.context.getService( "FileSystemService" );

Yes the overrides should be accessible.

1 Like