hello
i have a case with row_customaction
page_load:
if(CurrentUserLevel() == 1){
$this->CustomActions[“check”]= new ListAction(“check”, “APPROVE”, IsLoggedIn(),
ACTION_POSTBACK, ACTION_MULTIPLE, “Apakah Benar akan Approve?”,
“fa fa-check ew-icon”);
}
else if(CurrentUserLevel() == 2){
$this->CustomActions[“send”]= new ListAction(“send”, “SEND”, IsLoggedIn(),
ACTION_POSTBACK, ACTION_MULTIPLE, “Apakah Benar akan Mengirim Report Keatasan ?”,
“fa fa-check ew-icon”);
}
Row_CustomAction:
if ($action == “send”) { // Check action name
//$myRow = ExecuteRow(“SELECT * FROM MyTable WHERE XXX”);
$rsnew = [“status” => “send”,“aktorsend” => “.CurrentUserName().”]; // Array of field(s) to be updated
$result = $this->update($rsnew, “id = $row[id]”); // Update the current record only (the second argument is WHERE clause for UPDATE statement)
if (!$result) { // Failure
$this->setFailureMessage("Failed to update record, id = " . $row[“id”]);
return FALSE; // Abort and rollback
} elseif ($this->SelectedIndex == $this->SelectedCount) { // Last row
$this->setSuccessMessage(“Berhasil Mengirim Keatasan.”);
}
return TRUE;
}
I want to add logic to the condition if the field >= 40 then
$ rsnew = [“status” => “send”, “aktorsend” => “.CurrentUserName ().”];
if not
$ rsnew = [“status” => “reject”, “aktorsend” => “.CurrentUserName ().”];
apakah menggunakan query:
$myRow = ExecuteRow(“SELECT filed FROM MyTable WHERE ??”);
I’m confused where to do the query?
thank you