0

I'm working on a schedulable class that makes and http callout, I need my schedulable method to start my @future method with my callout. The error I'm getting is

" Method does not exist or incorrect signature: returnAuth()"

 global void execute(SchedulableContext sc) {
    returnAuth();
 }
 @future(callout = true)
  static void returnAuth(string loginstring, string Idstring) {
    string xAuthToken;
    string st_Today;
    If(loginstring != null) {

        HttpRequest req = new HttpRequest();
        HttpResponse res = new HttpResponse();
        Http http = new Http();

        req.setMethod('POST'); // Method Type

        req.setEndpoint('web210.ntree.com/twig-cstc3/v1/login'); //salestree url

        req.setHeader('Content-Type', 'application/json');
        req.setHeader('{ "username" : ', loginstring);


        res = http.send(req);

Anyone know how i can make this work?

  • 4
    The returnAuth takes two arguments loginString and IdString. Provide those two arguments in returnAuth method to remove this error. – Ashwani Aug 25 '15 at 18:40
  • 2
    @Ashwani Can you post that as an answer rather than a comment. Then the question can be marked as answered. – Daniel Ballinger Aug 25 '15 at 22:05
  • n.b. global modifier is not required unless doing managed package; public will suffice – cropredy Aug 26 '15 at 0:01
  • What is the line code which is causing this error? – Goki Aug 26 '15 at 5:02
2

The returnAuth takes two arguments loginString and IdString.

Provide those two arguments in returnAuth method to remove this error. This would resolve the problem.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.