You need to sign in to do that
Don't have an account?
imhere
queryResult.getRecords return Null ??? while isDone returns TRUE
Hi
I am Querying CustomObject__c.
If i set Where clause on Name Field it workds fine ... But if i set Where Clause to myCustomField__c It executes the Query (query.isDone() is TRUE) . But throws NullPoiterException on queryResult.getRecords()
Name and myCustomField have the same values.
what is the best practice to Query a CustomObject__c ??
here is the TWo differnt Codes i am using ...
NO ERRORS Query:
query("select Area_ID__c, Service_ID__c from UserService__c where Name='"
+ name + "'");
NULLPOINTER QUERY:
query("select Area_ID__c, Service_ID__c from UserService__c where myCustomField ='"
+ name + "'");
I am Querying CustomObject__c.
If i set Where clause on Name Field it workds fine ... But if i set Where Clause to myCustomField__c It executes the Query (query.isDone() is TRUE) . But throws NullPoiterException on queryResult.getRecords()
Name and myCustomField have the same values.
what is the best practice to Query a CustomObject__c ??
here is the TWo differnt Codes i am using ...
NO ERRORS Query:
query("select Area_ID__c, Service_ID__c from UserService__c where Name='"
+ name + "'");
NULLPOINTER QUERY:
query("select Area_ID__c, Service_ID__c from UserService__c where myCustomField ='"
+ name + "'");
--Sean
SimonF you are right actually there were no matching records.
I was trying to fetch records of AdjacentArea__c that has relationship with Area__c and other CustomObjects__c
what i was doing ... I was trying to fetch the Record " SELECT customField__c1, .... ..... FROM AdjacentArea__c Where Area__c=VALUE "
I was replacing value with the NAME Field of Area ... It was returning No Result. Because Area__c does not have the name value instead it has the ID value of Area__C Object.