List View Not Displaying Correct Data

Hi.

I have added some code in a attempt to make the “email opt out” field searchable by adding the following code to list.view.php, detail.view.php,etc. in the leads module.

public function preDisplay()
 	{
 		parent::preDisplay();
		$this->bean->opt_out_c = $this->bean->email_opt_out;
 	}

However this works fine in the Detail View but doesn’t show the correct value in list view. all leads show the field unchecked.

Any help would be greatly appreciated.

~Sam

You need to do a process record logic hook to access all the beans in the list view.

I have done a little reading into logic hooks and have added this:

class optouthook {
	function optOutListview(&$bean, $event, $arguments){
		$bean->opt_out_c = $bean->email_opt_out;
	}
	
}

This doesn’t seem to do anything so I assume I have not fully understood how to implement.

I know the hook is being called as I made a syntax error previously and got a parsing error, so I know something is happening.

~ Sam