You need to sign in to do that
Don't have an account?
Avinash Angasay
Soql/Sosl
1.) Get all the opportunities,contacts,notes related to an Account where Account Name starts with ‘B’.
Ans -select id,Name,(select id, Name,StageName From Opportunities), (Select id from Notes) ,(Select LastName from Contacts) from Account where Name like 'B%'
2.) Get the account name,notes,contacts related to an opportunity where opportunity name ends with ‘A’.
Ans-select id,Name,Account.name, (Select id from Notes) ,(Select id from OpportunityContactRoles) from Opportunity where Name like '%A'
Create a map for above,use the queries of - create all the maps asked below-
Where key will be the account id and list of records as value. It should be like this,
Create 3 maps for opportunities, contacts and notes: Map> Map> Map>
Ans -select id,Name,(select id, Name,StageName From Opportunities), (Select id from Notes) ,(Select LastName from Contacts) from Account where Name like 'B%'
2.) Get the account name,notes,contacts related to an opportunity where opportunity name ends with ‘A’.
Ans-select id,Name,Account.name, (Select id from Notes) ,(Select id from OpportunityContactRoles) from Opportunity where Name like '%A'
Create a map for above,use the queries of - create all the maps asked below-
Where key will be the account id and list of records as value. It should be like this,
Create 3 maps for opportunities, contacts and notes: Map> Map> Map>
The code will be as below.
You have to implement similar way for second one as well.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,