0

I am trying to get all the role from OpportunityContactRole into a list my code

OppContactRole = new List<OpportunityContactRole>();
OppContactRole = [SELECT Role FROM OpportunityContactRole];

and try to add this list VF page. I am getting my result from sOQL as

OpportunityContactRole:{Role=Owner, Id=00KO0000000J56pMAC}, 
OpportunityContactRole:{Role=Landlord, Id=00KO0000000J4hVMAS}, 
OpportunityContactRole:{Role=Owner, Id=00KO0000000J4qXMAS}, 
OpportunityContactRole:{Role=Owner, Id=00KO0000000J56fMAC}, 
OpportunityContactRole:{Role=Landlord, Id=00KO0000000J5P3MAK}, 
OpportunityContactRole:{Role=Access to House, Id=00KO0000000J6u7MAC}, 
OpportunityContactRole:{Role=Decision Maker, Id=00KO0000000J6u8MAC}, 
OpportunityContactRole:{Role=Owner, Id=00KO0000000J5MdMAK}, 
OpportunityContactRole:{Role=Landlord, Id=00KO0000000J5OyMAK}, 
OpportunityContactRole:{Role=Owner, Id=00KO0000000J574MAC},

In the result you can see that role is getting repeated but not id. I tested with the actual value in env but this list do not contain all the values from salesfroce. Is this any this i am missing out can you please guide me.

1

Selecting data from the OpportunityContactTole will yield data rows of OCR instances.

If you're looking to display a picklist of possible roles, then you need to do this via a describe.

http://blogs.developerforce.com/developer-relations/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.