[Vtigercrm-developers] Silly Question? Delete entity in Workflow Funtion?

Alan Lord (News) alanslists at gmail.com
Tue Jul 30 15:24:02 UTC 2013


Is this a daft Idea?

My customer would like records that get set to certain status to be 
deleted (Moved to the recycle bin).

So I created a simple Custom Workflow function:

function deleteRecord($entity) {
	$adb = PearDatabase::getInstance();
	
	// Get the triggering Account id
	$org = explode("x", $entity->getId());
	$orgid = $org[1];
	
	$entity->trash("Accounts", $orgid);
}

But it isn't working and I can't help thinking this is not really a good 
idea... When you are editing the status via Ajax and it triggers this 
workflow... Hmmm.

Any thoughts anyone?

Cheers

Al

-- 
Libertus Solutions
http://www.libertus.co.uk



More information about the vtigercrm-developers mailing list