//Java Script code function fetchRecord() { MyCustomController1.fetchRecord(handlefetchStudent); }
function fetchRecord()
{
MyCustomController1.fetchRecord(handlefetchStudent);
}
function handlefetchStudent(result,event){
if(event.type == 'exception') {
alert(event.message);
} else {
document.getElementById("resultDiv").innerHTML = result.toString();
}
}
//Apex Controller Method
@RemoteAction
public static Student__c fetchRecord()
{
Student__c student=[SELECT First_Name__c,Last_Name__c,Phone__c,Email_ID__c,Lang__c
FROM Student__c
LIMIT 1
];
RETURN student;
}
@RemoteAction
public static Student__c fetchRecord()
{
Student__c student=[SELECT First_Name__c,Last_Name__c,Phone__c,Email_ID__c,Lang__c
FROM Student__c
LIMIT 1
];
RETURN student;
}
//its Showing me [object Object]
[object Object]
How to fetch and dispaly data from this result?