• arunsath
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I am a newbie to SalesForce and trying to call a REST service in a custom button's onclick JavaScript.

I get error, Error 400 Endpoint protocol(http/https) mismatch: 

My endpoint is http://blah.blah.. and I can hit it separately in browser, so the RESt service getPrimaryQuoteDetails is working fine.

My onclick JavaScript code is as below. Can anybody throw light onto why this is not working? The site is listed as 'Remote Site' and I can also make a call to this service from a VF page. But the problem is the requirement is not to use VF page. This button is part of a custom object which is added to a standard opportunity layout.

Any answers or suggestions from gurus?

 

==========================================

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")} 

 

sforce.connection.remoteFunction({
url : 'http://c-----.com/----------/getPrimaryQuoteDetails.htm?quoteId=364926',
async : true,
cache : false,
method: "GET",
onSuccess : function(response) { alert('OK: '+response); },
onFailure : function(response) { alert('ERROR: '+response); }
});

 

Thanks,

mk2013

 

  • April 10, 2013
  • Like
  • 0