Scripting hint: Retrieving a workbook with a part droplist and hierarchy set and initializing some workbook variables

Kinaxis's picture
Printer-friendly versionPrinter-friendly version

created by on Jul 4, 2014 11:04 AM, last modified by on Jul 4, 2014 11:04 AM

The following is a single JavaScript statement that will instantiate a workbook object (myWorkbook) opening it on a specific scenario, filter and site group and also selecting a single entry on a part droplist (by display value), setting four different workbook variables (of four different types) and selecting a specific node on a specific hierarchy.

Note that every time you see square brackets [] in the statement below, they will enclose a comma-delimited JavaScript array of values.


// Example: Retrieving a workbook with a part droplist and hierarchy set.

var myWorkbook = rapidResponse.workbooks.get({ name:"My Workbook", scope:"Public" },


    scenarios: [{ name:"myScenario", scope:"Private" }],

    filter: {name: "Buy Parts", scope:"Public"},

    siteGroup: {name: "HQ", scope: "Public"},

    part: "= All =",

    variables: [

        {name: "showLate", value: true},

        {name: "onDate", value: rapidResponse.dateTime.TODAY},

        {name: "worksheetFilterExpression", value: "Order.Site.Value = 'HQ'" },

        {name: "maxQuantity", value: 4000}


    hierarchies: [{

        hierarchy: {name:"Customer", scope:"Public"},

        path: [{


            childPath: [

                {name:"Computer Mart"}





Copy this html code to your website/blog to embed this press release.


Post new comment

1 + 13 =

To prevent automated spam submissions leave this field empty.
Page execution time was 1374.96 ms.

Memory usage:

Memory used at: devel_init()=2.13 MB, devel_shutdown()=22.54 MB.