...
Code Block |
---|
|
function getDupProdIds(tId, selectedInputValues, that) {
let dupProdIds = []
let selectedItemId = selectedInputValues["CATLG_ITEM_ID"]
for (let i = 0; i < allTasks.length; i++) {
let currentTaskInput = that.getInputValueByID(allTasks[i].taskValues.taskId)
let currentTaskItemId = currentTaskInput["CATLG_ITEM_ID"]
if(currentTaskItemId == selectedItemId)
dupProdIds.push(currentTaskInput["productID"])
}
return dupProdIds
}
let that = this
let tIdsInputValues = this.getInputValueByID(tID)
let val = values["Select Action"];
if(val == "Duplicate"){
let dpValuIds = getDupProdIds(tID, tIdsInputValues, that)
//dpValuIds()
console.log("dup", dpValuIds)
this.changeFormValue("dup_productID", dpValuIds.join(), tID)
} else {
this.changeFormValue("dup_productID", tIdsInputValues["productID"], tID)
} |
14. Custom code: If a user clicks the "Submit and Get Task" button, the task shouldn't be submitted and an error message should display up insteadSyntax:
1: to Disable Buttons: The following custom code can be plugged in to disable/enable a few actions buttons conditionally.
i. To hide user action buttons
Code Block |
---|
this.hideUserTaskButtons([ |
...
"button 1 name", "button 2 name", …n]) |
2: to ii. To unhide user action buttons
Code Block |
---|
this.unhideUserTaskButtons([ |
...
"button 1 name", "button 2 name", …n]) |
Available options for button names:
Code Block |
---|
|
"SUBMIT & GET NEXT TASK"
"SAVE & EXIT"
"SKIP & GET NEXT TASK"
"SUBMIT TASK & EXIT" |