Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Get OptionSet Value according to Criteria using Plugin

$
0
0

HI Expert i am able to get the OptionSet Values. but i want to get the values by criteria(e.g. parentcustomerid). I am pasting my code here through which i am getting the OptionSet Values. But here  how to set the Criteria. Please Suggest.

RetrieveAttributeRequest request= new RetrieveAttributeRequest()
                     {
                         RequestName="RetrieveAttribute",
                         EntityLogicalName="contact",
                         LogicalName="new_optionValue",
                         RetrieveAsIfPublished=true                                            
                     };
                   RetrieveAttributeResponse retrieveAttributeResponse =(RetrieveAttributeResponse)crmService.Execute(request);
                   PicklistAttributeMetadata retrievedPicklistAttributeMetadata =(PicklistAttributeMetadata)
                   retrieveAttributeResponse.AttributeMetadata;
                   OptionMetadata[] optionList =retrievedPicklistAttributeMetadata.OptionSet.Options.ToArray();
                  entity.Attributes.Add("address1_name", optionList[0].Value);// for Test

Thank You


saroj



Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>