Action from Dashboard
This section explains how to make a link which will perform a certain action for a given document.
Dashboard Portlet with a list of Quotes in Result Matrix
Example of using the linkCell() method to create a link with an action:
import net.pricefx.common.api.FieldFormatType
import net.pricefx.formulaengine.scripting.AppPages
def quotes = api.find("Q", 0, 10, "-uniqueName")
def resultMatrix = api.newMatrix().withColumnFormats([
"uniqueName" : FieldFormatType.STRING,
"label" : FieldFormatType.STRING,
"expiryDate" : FieldFormatType.DATE,
"workflowStatus": FieldFormatType.STRING,
"action" : FieldFormatType.LINK
])
def getTargetPageState(itemId) {
return [
id : itemId,
tpAction: 'SUBMIT'
]
}
def rows = quotes.collect {
[
uniqueName: it.uniqueName,
label : it.label,
expiryDate: it.expiryDate,
workflowStatus: it.workflowStatus,
action : it.workflowStatus == "DRAFT" ?
resultMatrix.linkCell('Submit',
AppPages.QC_DETAILS_PAGE,
getTargetPageState(it.typedId)
) : null
]
}
return resultMatrix.withRows(rows)
Looking for labels? They can now be found in the details panel on the floating action bar.
Related content
Contextual Action from Dashboard Chart
Contextual Action from Dashboard Chart
Read with this
How to Add a Link to Dashboard
How to Add a Link to Dashboard
More like this
Interactive Dashboards
Interactive Dashboards
Read with this
How to Create Wizard Dashboard
How to Create Wizard Dashboard
More like this
How to Create Wizard Dashboard
How to Create Wizard Dashboard
More like this
Action from Simple Link
Action from Simple Link
More like this
Found an issue in documentation? Write to us.