You need to sign in to do that
Don't have an account?
Sowjanya Saride
Can I get Account Name using AccountID of a CASE?
Hello All,
As a newbee, trying to debug Account Name of Cases whose status = NEW with the help of Case.AccountID in logs the following:
My approach is as below:
public class NewCaseListController {
public List<Case> getNewCases()
{
String n = 'NEW';
List<Case> results = [SELECT ID,
CaseNumber,
Status ,
AccountId
from CASE
WHERE Status=:n];
System.debug(results.size());
for(Case c : results)
{
System.debug('CASE ID = '+ c.Id);
System.debug('CASE NUMBER = '+ c.CaseNumber);
System.debug('Account ID = '+ c.AccountId);
System.debug('CASE STATUS = '+ c.Status);
}
return results;
}
}
My attempt failed.
Can I get Account Name using AccountID of a CASE? If so, Please please do enlighten how this can be done?
Thanks in Advance.
-LS
As a newbee, trying to debug Account Name of Cases whose status = NEW with the help of Case.AccountID in logs the following:
My approach is as below:
public class NewCaseListController {
public List<Case> getNewCases()
{
String n = 'NEW';
List<Case> results = [SELECT ID,
CaseNumber,
Status ,
AccountId
from CASE
WHERE Status=:n];
System.debug(results.size());
for(Case c : results)
{
System.debug('CASE ID = '+ c.Id);
System.debug('CASE NUMBER = '+ c.CaseNumber);
System.debug('Account ID = '+ c.AccountId);
System.debug('CASE STATUS = '+ c.Status);
}
return results;
}
}
My attempt failed.
Can I get Account Name using AccountID of a CASE? If so, Please please do enlighten how this can be done?
Thanks in Advance.
-LS
Case object is the child of account, you can write the child to parent SOQL to get the parent data.
Check below Example
Child to Parent Query Parent to Child Query Kindly mark this as solved if the reply was helpful.
Thanks
Shaik
All Answers
Case object is the child of account, you can write the child to parent SOQL to get the parent data.
Check below Example
Child to Parent Query Parent to Child Query Kindly mark this as solved if the reply was helpful.
Thanks
Shaik