function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vasu takasivasu takasi 

how to get sOjects records from remotesAction

hi i am trying to get sObject records using RemoteAction .In vf page I am unable to retrive field names , in the alert i am getting as undefined. Please any one can help me.

 

page---

 Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.CustomLeadConversion.RecentMappingsRmt}',objApiName,
            function(result, event){
                if (event.status) {
                  if(result != null){
                   alert(result[0].name);
             }
          }
        });

class----

@RemoteAction
     global static list<mapping__c> RecentMappingsRmt(string objectname) {
         mapping__c[] lstmappings=new mapping__c[]{};
         
         lstmappings=[select name,Source_Field__c,Target_Field__c from mapping__c where name=:objectname];
         return lstmappings;
         
     }