I am trying to call the metadata api call -reterive in the javascript in vf page. I am getting error load resource: the server responded with a status of 404 (Not Found)

<apex:page controller="depoloymentsheet">
  <apex:form >
  <script src="https://xxxxxx.salesforce.com/soap/ajax/38.0/connection.js"  
  function compextract() {
    var myList = new Array();
    myList = '{!Apilist}';
    var Res=sforce.connection.retrieve(myList);
  <apex:facet name="header">Deployment Tool</apex:facet>
  <apex:commandButton onclick="compextract();" value="Reterive" id="theButton"/>


public class depoloymentsheet { 
    public List<release__c> Apilist{get;set;} 
    public depoloymentsheet() { 
        Apilist=[SELECT Id,ObjectApiname__c FROM release__c]; 
  • What's in myList? That's probably where your problem lies. – Caspar Harmer Sep 22 '16 at 6:52
  • Also, this won't work: var Res=sforce.connection.retrieve(myList); alert(res); - Javascript is case sensitive, so your alert will show nothing. – Caspar Harmer Sep 22 '16 at 6:55
  • "Mylist" is the java array which hold the component api names.Apilist is list in apex class which will query the api names in the object called release. – Vidhyasagaran Muralidharan Sep 26 '16 at 16:30

Your Answer

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

Browse other questions tagged or ask your own question.