martes, 31 de julio de 2012

OptionSet Global

Y ahora, tengo un OptionSet (picklist para los conocedores jejej) Global, y no sé cómo conseguir el valor. La primera opción, dar un vistazo al SDK de Dynamics.

En el sdk he conseguido un mensaje muy interesante, el RetrieveOptionSetRequest.

Ahora como lo implementamos?, acá una opción.

 

   1:   RetrieveOptionSetRequest oRetrieveOptionSetRequest = new RetrieveOptionSetRequest()
   2:              {
   3:                  Name = sName
   4:              };
   5:   
   6:  RetrieveOptionSetResponse oRetrieveOptionSetResponse = (RetrieveOptionSetResponse)oService.Execute(oRetrieveOptionSetRequest);
   7:  OptionSetMetadata oOptionSetMetadata = (OptionSetMetadata)oRetrieveOptionSetResponse.OptionSetMetadata;
   8:  OptionMetadata OptionSelected = oOptionSetMetadata.Options.FirstOrDefault(p => p.Label.UserLocalizedLabel.Label.ToUpper().Equals(sNameOption.ToUpper()));
   9:  return OptionSelected.Value;

Salu2

Atilin

Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Email
  • More...

0 comentarios

 
© 2011 Dynamics CRM Rulez !!!!!!
Designed by BlogThietKe Cooperated with Duy Pham
Released under Creative Commons 3.0 CC BY-NC 3.0
Posts RSSComments RSS
Back to top