Advanced Scripting - Browser Debugging Tools and the JavaScript Object Model (Video Tip)

This is a great introductory video for those interested in learning how to script with Dundas BI to create new and custom behaviours or features. When presented with an interesting scripting problem in Dundas BI, you can use the browser tools to help you understand what is going on. In this tip, I will take an actual question from the Dundas BI User Forum and show how to solve the problem and my methodology to approach the solution.

Sample goal: How can we programmatically control the ‘Group First’ option in the sort via script.

Here is a completed sample that I created to test this.

Sample Script:

var overrideString = "{\"adapterId\":\"72099a99-b18d-5c23-9d45-7ebd291ec40b\",\"metricSetBindingId\":\"a641df4e-fb73-4fdf-9909-d388171444ea\",\"requestOverrides\":{\"__classType\":\"\",\"isResultTransposed\":false,\"isTotalsAtBottom\":true,\"measureOverrides\":[],\"hierarchyOverrides\":[],\"sortPriorityOverrides\":[\"Continent\",\"Country\",\"Product\",\"Index\"],\"isTimeMemberSharingEnabled\":false,\"itemizeTotals\":false}}";
var overrides = JSON.parse(overrideString);
this.parentView.control.overrides.metricSetBindingOverrides = [overrides];
this.parentView.control.overrides.metricSetBindingOverrides[0].requestOverrides.sortPriorityOverrides = ["Product", "Country", "Continent", "Index"];

If you’d like to learn more, I’d recommend you go to my learning channel - Off the Charts (with Jeff).


Updated the title to make this video a bit easier to find (hopefully). This video is a must for users new to scripting in Dundas BI, and I highly recommend it.

This is awesome, great step by step info! Thanks!

1 Like