You need to sign in to do that
Don't have an account?
Veena Gopal
trailhead apex web services
the question in the challenge is:The method must return the ID and Name for the requested record and all associated contacts with their ID and Name.
but ppl have passed the trailhead by using similar code:
Account result = [Select Id,Name ,(Select Id, Name From Contacts) From Account where Id = :accId];
return result;
When i put this in the execute anonymous window:-
I get only the account id i do not get the contact ids related to it.
How to go about doing it?
Please help.
but ppl have passed the trailhead by using similar code:
Account result = [Select Id,Name ,(Select Id, Name From Contacts) From Account where Id = :accId];
return result;
When i put this in the execute anonymous window:-
Account result = [Select Id,Name ,(Select Id, Name From Contacts) From Account where Id = '00128000005ee4zAAA']; system.debug(result);
I get only the account id i do not get the contact ids related to it.
How to go about doing it?
Please help.
Sorry for late response actualy I was in my home town.
As per your response I have tried in multiple orgs min 10 and got the same result means all accounts with contacts.
Here is my class that I have used for the challenge hope this will help. Test class.
Hi - I could use some input on the CaseManager code that is at the beginning of the trailhead.
I enter the code exactly as the trailhead describes abd attempt to hit the '/services/apexrest/Cases/' url with workbench but I get the following error. What am I missing?
Service not found at: /services/apexrest/Cases/
You can make a loop using : result.contacts.size()
Then access all contacts using this format : result.contacts[0].Id;
Or another way:
for (Contact ct : result.contacts)
{
system.debug(ct.id);
}