MS CRM 2016/8/22 - 关于pre-operation plugin
2016-08-23 14:09
120 查看
最近有一个任务是用一个pre-operation plugin去call 一个external的restful API.
因为用户的需求,使用了-pre-update, preimage和filter attribute.
1. 如何判断field为空
使用attribute.contain而不是判断是不是为null, 因为如果field的值为空时,preimageentity 和 target entity都不会包含这个attribute.
2. 除了text field之外的其他类型的field
text field可以直接使用toString()去直接转化, 但是其他类型的field比如lookup, datetime 和 Guid, 你需要先转化attribue[]中的object为对应的类型, 然后去获得对应的值,如lookup的ID, optionSet 的value.
3. optionSet的text value
不使用attribute而使用formattedvalue[ ]
4..preimage 和 filteredAttribute
preimage 包含所有没修改前的值
plugincontext中包含filteredAttribute中被修改的field, 以及实体的ID, modified on等值,也就是说你可以在这个实体中找到被修改的值。
通过这个plugin, 之前遗忘的一些知识都得到了复习, 还学习了如何消费external restful api.
之后准备翻译一些比较有帮助的英文博客以及crm 论坛上一些有意思的问题和回答。
因为用户的需求,使用了-pre-update, preimage和filter attribute.
1. 如何判断field为空
使用attribute.contain而不是判断是不是为null, 因为如果field的值为空时,preimageentity 和 target entity都不会包含这个attribute.
2. 除了text field之外的其他类型的field
text field可以直接使用toString()去直接转化, 但是其他类型的field比如lookup, datetime 和 Guid, 你需要先转化attribue[]中的object为对应的类型, 然后去获得对应的值,如lookup的ID, optionSet 的value.
3. optionSet的text value
不使用attribute而使用formattedvalue[ ]
4..preimage 和 filteredAttribute
preimage 包含所有没修改前的值
plugincontext中包含filteredAttribute中被修改的field, 以及实体的ID, modified on等值,也就是说你可以在这个实体中找到被修改的值。
通过这个plugin, 之前遗忘的一些知识都得到了复习, 还学习了如何消费external restful api.
之后准备翻译一些比较有帮助的英文博客以及crm 论坛上一些有意思的问题和回答。
相关文章推荐
- 关于fatal error C1083: Cannot open precompiled header file:/'Debug/v13_3.pch/': 错
- 关于Ngen(pre-JIT)安全性的讨论
- 关于 java.lang.IllegaAccessError:Class ref in pre-verified class resoved to unexpected implementation
- 关于share prefrences功能的一些理解
- 关于PremultipliedAlpha理解
- 关于<pre></pre>标签 IE6,7下实现white-space:pre-wrap;
- 关于fatal error C1083: Cannot open precompiled header file: /'Debug/xxx.pch/': 错
- 关于浏览器自动加上<pre>标签
- 关于***-Prefix.pch has been modified since the precompiled header was built的错误
- 关于VC的project-〉 setting-〉c/c++,Category:Precompiled Headers,选第二个和第四个的区别?
- 关于fatal error C1083: Cannot open precompiled heade
- VC中关于编译时候的错误提示:is not a precompiled header
- 关于VC的dialog框PreTranslateMessage不响应现象及解决办法
- 关于编译错误 fatal error C1083: Cannot open precompiled header file
- 关于fatal error C1083: Cannot open precompiled header file: /'Debug/v13_3.pch/': 错
- 转关于水平线和center标签和pre预格式化
- 关于框架类和视图类的PreCreateWindow函数的重载!!
- 最后推荐一篇关于Pre-Echo的总结论文
- 关于fatal error C1083: Cannot open precompiled header file: /'Debug/v13_3.pch/': 错误
- 关于PreTranslateMessage