Golden Rules
1. Platform only passes Entity attributes to Plugin that has change of data.
2. If the user does not enter any value into attribute, the attribute is not avaible in AttributeCollection of Entity.
3. Always check if attribute is present in the collection before you use it.
介于上面三条rules, 我们来改动一下上篇博客中的问题.
如果用户firstName 没有输入, 将会以下面截图的内容一样报错.
为了避免这个问题, 我们需要对代码做一系列的修改.
我们要在代码上面做null check
在register tool 上选中之前创建的assembly, 并且勾选update,做更新.
我们这次再测试一下创建新的contact.
这时候可能有人会问到, last name 为什么不检测呢? lastName 是必填项, 不必在代码中再做检查.
转载于:https://www.cnblogs.com/TheMiao/p/10663088.html
最后
以上就是深情老虎最近收集整理的关于创建一个dynamics 365 CRM online plugin (二) - fields检查的全部内容,更多相关创建一个dynamics内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复