+ Start a Discussion
MPetersenMPetersen 

Sales Force for Twitter Assistance

Hello,

 

I've been trying to use the  AutomationWrapper class for SalesForce for Twitter.  Here is the code I am using as a test of the doSearch method in the AutomationWrapper:

 

 global class TwitterScheduler {
    webService static void runTwitterSearch(){
        
        integer i=1;
        List<sf4twitter__Twitter_Search__c> tsearch = [SELECT Id, Name, sf4twitter__Twitter_Keyword_Search__c FROM sf4twitter__Twitter_Search__c];
        
        for(sf4twitter__Twitter_Search__c twitsearch: tsearch){
            while (i>0){
                i=AutomationWrapper.doSearch(twitsearch,i);
            }
        }
    }

}

 

When trying to save I get  "Save error: Method does not exist or incorrect signature: AutomationWrapper.doSearch(SOBJECT:sf4twitter__Twitter_Search__c, Integer)    WTL/src/classes    TwitterScheduler.cls    line 9    1259686413987    2942".

 

This is what I'm reading for this method:

 

"Get tweets from Twitter Searches
Integer doSearch(Twitter_Search__c, Integer)
Params:
Twitter_Search__c : Search Keyword to be searched for matches
Integer : Page number to be queried.
Returns:
Integer : Next page to be queried if any, or 0 if no more pages available."

 

Any thoughts on what I'm doing wrong?  Thanks,

Marc

WesNolte__cWesNolte__c

Hey

 

Just to check for the obvious, doSearch() is static correct? Does AutomationWrapper exist within this global class or is it standalone? Could you post the class and method signature please?

 

Wes

MPetersenMPetersen

I honestly don't know if doSearch() is static or not as the code is hidden.  It is part of the SalesForce for Twitter Installed Package.

 

The only hint I have on usability of this method is the blurb from the Setup Guide that says this method exists and can be used to run as a scheduled job. See page 26 of  http://sites.force.com/appexchange/servlet/servlet.FileDownload?retURL=%2Fappexchange%2Fapex%2Fuploadedcontent%3Fid%3D00P30000003xKatEAE&file=00P30000003xKatEAE

 

I have tried it with and without the name space sf4twitter in front of the method, and nada.

 

I hope this information helps answer my question and hasn't increased confusion.

 

Please let me know.

 

Thanks,

Marc

 

WesNolte__cWesNolte__c

Yeah it's not clear. I would start making the problem a bit simpler.. start by calling the method locally i.e.

 

void runTwitterSearch(){
        
        integer i=1;
        List<sf4twitter__Twitter_Search__c> tsearch = [SELECT Id, Name, sf4twitter__Twitter_Keyword_Search__c FROM sf4twitter__Twitter_Search__c];
        
        for(sf4twitter__Twitter_Search__c twitsearch: tsearch){
            while (i>0){
                i=AutomationWrapper.doSearch(twitsearch,i);
            }
        }
    }

 

I'm guessing it can't 'see' the method because it's not static, and your method is.

 

Wes

MPetersenMPetersen

Thanks Wes,

 

This does seem to be the problem.  I finaly received an error that said Method Can Not Be Seen.  This was after trying it a million different ways.

 

The question then becomes, is there a way to call this method from a webMethod?  Don't all web methods need to be static?

 

If it can't be done then now worries, just curious.

 

Thanks a ton,

Marc

WesNolte__cWesNolte__c

Hmmm.. this got me wondering because Automation.doSearch() looks like a static method call, so I've been digging. 'Automation' is global, so doSearch probably is static. Look at the documentation our syntax has been a bit off:

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_namespace_prefix.htm

 

But correcting it hasn't worked. I've asked a few peeps who might be in the know, and I'll get back to you.

 

Wes

 

MPetersenMPetersen

Any new information?  Just thought I would check.

 

Thanks,

Marc

WesNolte__cWesNolte__c

Logged with premier support, still waiting on feedback :(

 

Wes