You need to sign in to do that
Don't have an account?
How do i get original text when executing in Apex Query....????
Hi
I m using following Apex Class code...
---------------------------------------------------------------------------------------------------------
List<Attendance__c> r=[SELECT Id,attendance_Date__c,attendance_Roll__c,Remarks__c,student_Name__c FROM Attendance__c WHERE classname__c='Learn Corn' AND attendance_Date__c=2012-05-12];
Attendance__c r1;
if(r.size()>0)
{
r1=new Attendance__c(Id=r[0].Id);
return r[0];
}
else
return new Attendance__c();
---------------------------------------------------------------------------------------------------------
My table records
---------------------------------------------------------------------------------------------------------
Id : a0590000002LE9sAAG
ClassName : Learn Corn -- From Look up
Attendance Date : 5/12/2012
Attendance Roll : Present
Remarks : Hello
Student Name : Gio -- From Look up
---------------------------------------------------------------------------------------------------------
but when i debug it is not working, rather than return values are like
---------------------------------------------------------------------------------------------------------
Id : a0590000002LE9sAAG
ClassName : Learn Corn
Attendance Date : 1336780800000
Attendance Roll : Present
Remarks : Hello
Student Name : 0039000000CYP14AAH
Class Name : a0390000002vWW9AAM
---------------------------------------------------------------------------------------------------------
How do i get original text when executing in Apex Query....????
Id : a0590000002LE9sAAG
ClassName : Learn Corn
Attendance Date : 1336780800000
Attendance Roll : Present
Remarks : Hello
Student Name : 0039000000CYP14AAH// here u need to use student_name__r.name if the look up field name is student_name__c
Class Name : a0390000002vWW9AAM// same as above...class_name__r.name
All Answers
Id : a0590000002LE9sAAG
ClassName : Learn Corn
Attendance Date : 1336780800000
Attendance Roll : Present
Remarks : Hello
Student Name : 0039000000CYP14AAH// here u need to use student_name__r.name if the look up field name is student_name__c
Class Name : a0390000002vWW9AAM// same as above...class_name__r.name
When you use a relationship name in a query, you must use the relationship names without the__c. Instead, append an__r
(underscore underscore r).
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_relationships.htm#topic-title
This is what you need to refer please mark as solved if above is what you need
Thank you... It is working fine...
but the Date field return only the Id.... what can I do for get the Date....????