Workflow Rule - Execute SQL Statement

Hi,

I'm attempting to have a SQL statement be executed in a Workflow Rule that will update any communication with 'New Sale' in it's comm_subject for the specific opportunity the workflow is being actioned on.

I'll try and explain our process;

  • After creating the Opportunity, the user will click 'Qualify' which will create a task with the comm_subject - 'Follow up on New Sale #oppo_referenceid'.
  • This will fire a task off in two days to remind the user to perform an action.
  • As they progress down the workflow if they reach the point where they need to chase the customer on their quote and this is where we need to mark the first task as complete so we can open a new task to follow up with the customer in 4 days.

So far I've got;

Update Communication

Set Comm_Status = 'complete'

where Comm_Subject LIKE '%New Sale%'


However, this statement will affect all Tasks with 'New Sale' in the comm_subject. Which obviously we don't want, how do I make it specific to the opportunity the user is working in and not mark every task with 'New Sale' as complete?

I believe it's something to do with the ## codes but is there one for current opportunity?