...
The “action” logic can do anything we allow in the Groovy Sandbox. Here we just recalculate the LPG items. But it could as easily create a new PriceGrid or PriceList with the selected SKUs.
Dashboard Logic
The Dashboard logic contains the following elements:
Paste code macro | ||||
---|---|---|---|---|
| ||||
api.findPriceGrids(null, null) |
...
Paste code macro | ||||
---|---|---|---|---|
| ||||
if (!api.getElement("input_activate_click")) return api.dashboard("JJ_embedded_event_chart") // Show the dashboard embedded ... .showEmbedded() // ... and reevaluate it on "myEvent" // Note: "dashboardWideEvent()" fce makes the event local // to the containing dashboard instance .andRecalculateOn(api.dashboardWideEvent("myEvent")) // Pull the "customerId" attribute out of the event payload and expose it // as the "Customer Id" input to the embedded dashboard .withEventDataAttr("sku_attribute").asParam("SKU") //.withEventDataAttr("bandBy").asParam("CustomerClass") |
Action Logic
The action logic contains the following elements:
Paste code macro | ||||
---|---|---|---|---|
| ||||
def pg_id = api.decimalUserEntry('PG_id') // test value if (pg_id == null) { pg_id = 5 // "Fourth Live Price Grid" } pg_id as Long |
...