检索Optionsets 2011年动态 [英] Retrieve Optionsets in Dynamics 2011

查看:128
本文介绍了检索Optionsets 2011年动态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此代码来获取全球optionsets

I am using this code to retrieve global optionsets

var request = new RetrieveOptionSetRequest {Name = "OptionsetNameGoesHere"};
var retrieveOptionSetResponse =(RetrieveOptionSetResponse) DynamicsHandler._serviceProxy.Execute(request);
var retrievedOptionSetMetadata =(OptionSetMetadata) retrieveOptionSetResponse.OptionSetMetadata;
var optionList = retrievedOptionSetMetadata.Options.ToArray();

foreach (var optionMetadata in optionList)
{
   Printout(optionMetadata.Label.LocalizedLabels[0].Label + "\n");
}



但我怎么找回像AccountCategory(AccountCategoryCode),这样我可以绑定optionsets他们到一个ComboBox?

But how do I retrieve optionsets like AccountCategory (AccountCategoryCode) so that I can bind them to a Combobox?

推荐答案

您应该具有的 RetrieveAttributeRequest 。它会返回一个 RetrieveAttributeResponse 包含物业 AttributeMetadata

You should get it with a RetrieveAttributeRequest. It will return an RetrieveAttributeResponse which contains the Property AttributeMetadata.

在你的情况下,它应该是类型的 OptionSetMetadata ,这是你在找什么。

In your case it should be of type OptionSetMetadata, which is what you are looking for.

这篇关于检索Optionsets 2011年动态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆