One of the action you can add on ResultMatrix is to have a button, which will navigate to another page to perform an action with selected list of items from the matrix.
Before the button performs the action - it is either a Deep link or a Context link. To perform the action, it needs the definition of the action - so it will call the BackEndAction Logic, to retrieve the definition.
Logic API
Logic Nature: generic (null)
Logic Type: Calculation/Pricing
Execution Types
Standard - the logic is only executed via normal execution
Information provided to the logic
Inputs
InputMatrix input with list of items selected in the ResultMatrix. The name of this input is set in the call of method rowSelectionBackEndAction()
Expected logic execution outcome
first visible element (with Display Mode = Everywhere) is expected to return a Map with definition of the action link. It can be either Deep link or Context link. See code sample below.
if the logic fails with exception:
the jump to another page will not happen
and the frontend can display an error, which was set via withFailureMessage().
Code Samples
Example of BackEndAction Logic:
def products = api.inputMatrix('productsDataSet', 'sku') return [ targetPage : AppPages.QC_NEW_QUOTE, targetPageState: [ targetPageItems: products.collect { it -> return it.sku }, targetPageTab: 'items' ]
Example of logic which built the Result Matrix, which creates the action button, which called the BackEndAction Logic:
def products= api.find("P", 0, 10, null, ["sku", "label", "currency"]) def resultMatrix = api.newMatrix().withColumnFormats([ "sku" : FieldFormatType.TEXT, "label":FieldFormatType.TEXT, "currency": FieldFormatType.TEXT ]).withRows(products); resultMatrix.rowSelectionBackEndAction("productsDataSet") .withLogicName("BackEndActionLogic") .withColumns("sku") .withButtonLabel("New Quote") return resultMatrix