You need to sign in to do that
Don't have an account?
uni
how to retrive single record from a 1st custom object having relatedlist from 2nd custom object
can u give me an idea that how to retrive single record from a 1st custom object having relatedlist from 2nd custom object
2nd custom object is having master relation ship with 1st...............
thanq
Hi,
if u retrive the record from child query to get parent record means just write ordinary query.
if u r retrieve the record from paernt query to get child record means inner query needed.
Regards,
Rajesh.
public List<FirstObj__c> firstObjList = new List<FirstObj__c>();
public FirstObj__c firstObjSingleRecord = new FirstObj__c():
firstObjList = [select id,name,LookupField__c from FirstObj where LookupField__c = SecondObj.id];
if(firstObjList.size()>0){
firstObjSingleRecord = firstObjList.get(0);
}
If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.
Thanks
not working yar
Please mention what is the error coming.