首页 > 其他 > 详细

怎样创建一个dynamics 365 CRM online plugin (二)

时间:2019-04-06 22:57:02      阅读:171      评论:0      收藏:0      [点我收藏+]

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 是必填项, 不必在代码中再做检查.

 

怎样创建一个dynamics 365 CRM online plugin (二)

原文:https://www.cnblogs.com/TheMiao/p/10663088.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!