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
rajesh_yrajesh_y 

java script remoting

 

global class remoteTest1 {  

    

     @RemoteAction 

     global static Contact[] findContacts(string Name) {  

        Name = '%'+Name+'%';  

         Contact[] c = [SELECT ID, Name, Phone, Email from Contact where NAME LIKE :Name ];      
             return c;  

    }  

    

 }

 

 

 this is the code for remoting 

in that i am not getting values of account 

please help me

 

kruti tandelkruti tandel

If you want to fetch  data from Account  then query fir on Account object

Like this  :

 

global class remoteTest1 {  
     @RemoteAction 
     global static Account[] findAccount(string Name) {  
        Name = '%'+Name+'%';  
         Account[] acc = [SELECT ID, Name from Account where Name LIKE :Name ];      
             return acc;  
    }  
    
 }

 

rajesh_yrajesh_y

Thank you for your reply 

 

Sorry in the above post i mentioned account  insted of contacts

i am not able to get contacts even accounts also

its not working fine

 

help me on this area

 

 

thank you 

rajesh

india