Creating an Array using Page Load and Custom Action

Hi,

I need some advice on creating an array using List Page Load and Row_Custom Action. I’m trying to select certain records, get the email address and then pass the email addresses to an array (which I then intend to copy to the clipboard for quick small group emailing)

I’ve managed to get the List Page Page_Load partially working using:

function Page_Load() {
if (!IsLoggedIn()) $this->Page_Terminate(“login.php”);
$this->CustomActions[“BCC”] = new cListAction(“BCC”, “BCC Email”, IsLoggedIn(), EW_ACTION_AJAX, EW_ACTION_MULTIPLE, “Send to BCC?”, “glyphicon glyphicon-envelope ewIcon”);
//echo “Page Load”;
}

For the CustomAction I have:
function Row_CustomAction($action, $row) {
if ($action == “BCC”) {//record selected for BCC
$email = $row[“Email-Home”];
$BccEmail = array($results,“Email-Home”);
echo $BccEmail; //review the output
// Return FALSE to abort
// return TRUE;
}
}

When I select a record and hit the action button I get a pop up saying “Send to bcc?” but when I click on OK it says " ‘BCC Email’ failed"

I have read the help files until my eyes are bleeding but I’m still stuck - any ideas?

Press F12 → Network, check the network response. You probably have errors in your Row_CustomAction codes.

It will cause an error in “Row_CustomAction” server event, since the $result variable has never been declared before.

Hi,

I’ve looked in the Network and there are no errors showing

I’ve then commented out the line with $results in:

// Row Custom Action event
function Row_CustomAction($action, $row) {
if ($action == “BCC”) {//record selected for BCC
$email = $row[“Email-Home”];
//$BccEmail = array($results,“Email-Home”);
echo $email;
// Return FALSE to abort
// return TRUE;
}
}

My understanding is that this should set the variable $email to the value of the field “Email-Home” and out put it - but it doesn’t. I’m getting the same error message.

Make sure you do not remove return TRUE line.

Thanks - that worked. I can now try and refine my code!