+ Start a Discussion
NatashaNatasha 

Unable to get information for a task

I need to get a TASK ID for a created task by our application which is integrated with SF.
All that I have is the Email Subject, and the value for EmailName__c which is a customized attribute for the client's account in which the task is created.

I am running the following query:

Select AccountId, Id from task where Subject='ExactTarget Email: %%FirstName%%, would you like to be MindLeaders guest in Las' and Status = 'Completed' and EmailName__c = 'PLuS Promotion'

I use the software given to us by SF to run such queries and the operaiton always times out. And if I use a C#application, I set the batch size as 50 but the operation never results in any records. The data as per me is correct based on the task that I am trying to retreieve.

Can anyone guide me as to what can be wrong? The log in for this account succeeds.

 

DevAngelDevAngel

Hi Natasha,

Is the query in your post exact (no pun intended)?  When using the = operator you can't use wild cards.  I think a better query might be:

Select AccountId, Id from task where Subject like 'ExactTarget Email: %FirstName%, would you like to be MindLeaders guest in Las%' and Status = 'Completed' and EmailName__c = 'PLuS Promotion'

If the FirstName is some variable and you are using the %% to indicate the value of that variable, then the important differences are the use of the Like operator and the wild card at the end of the query.