使用 CRM 4.0 Web 服务设置 BusinessEntity 选择列表值
我正在尝试在 CRM 4.0 中创建一个 ImportMap 对象。我需要设置 TargetEntity 属性,它是一个选项列表值。 链接文本 似乎暗示可以通过使用来完成,
importmap map = new importmap();
map.name = "test map";
map.targetentity = new Picklist();
map.targetentity.name = "Contact"
但这似乎总是将目标实体属性保留为空。
有什么想法吗?
I'm trying to create an ImportMap object in CRM 4.0. I need to set the TargetEntity property which is a Picklist value. link text seems to imply that it can be done by using
importmap map = new importmap();
map.name = "test map";
map.targetentity = new Picklist();
map.targetentity.name = "Contact"
but this always seems to leave the target entity property as null.
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果它是一个选择列表,您将必须提供索引值。假设您有一个名为 TargetValues.Contact 的枚举,其值为 1,那么它会像:
-- 编辑 --
我相信对于您想要实现的目标,您将必须以某种方式检索目标实体,只有这样您才能来列举它们。
查看此内容,可能会有所帮助。
如果上述方法没有用,那么您可以执行以下操作:
但不知何故,索引可能会在一段时间内发生变化,因此在这种情况下,您可以使用这些值/索引创建一个枚举 xml,并在运行时加载它们。但这种方法的问题是:
不太好的方法,但是在紧迫的最后期限内,这是你可以做的;这永远不会破坏或造成麻烦。只是 xml 加载部分不太好。
顺便说一句,如果您浏览 CRM SDK,您会发现类似的示例。
If its a pick list, you will have to provide the index value. Assuming that you have an enum called TargetValues.Contact having value 1, then it would go like:
-- Edit --
I believe for what you are trying to achieve you will have to somehow retrieve the target entity and only then you will be able to enumerate them.
See this, probably this would help.
If above is of no use, then following is how you can do it:
But then somehow indices may change over a period of time, so in that case you can create an enumerated xml with those values/indices, and load them on runtime. But the problem with this approach is that:
Not-so-good approach, but running against a ticking deadline this is what you can do; this is never going to break or cause trouble. Just that xml loading part is not good.
Btw, if you would go through the CRM SDK, you will find the examples of similar sort.
使用此函数动态请求选项列表值:
Take this function to dynamic request picklist values: