zoukankan      html  css  js  c++  java
  • 创建一个dynamics 365 CRM online plugin (二)

    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 没有输入, 将会以下面截图的内容一样报错. 

    为了避免这个问题, 我们需要对代码做一系列的修改.

    创建dynamics CRM plugin

    创建dynamics CRM plugin

    我们要在代码上面做null check

     创建dynamics CRM plugin

    在register tool 上选中之前创建的assembly, 并且勾选update,做更新.

    创建dynamics CRM plugin

    我们这次再测试一下创建新的contact. 

    创建dynamics CRM plugin

    创建dynamics CRM plugin

    这时候可能有人会问到, last name 为什么不检测呢? lastName 是必填项, 不必在代码中再做检查.

  • 相关阅读:
    正则表达式---用户验证
    最短路 Dijkstra
    最短路 Dijkstra+堆优化
    LCIS(最长公共上升子序列)
    最小生成树 Kruskal
    网络流 最大流
    网络流 最小费用最大流
    树链剖分
    树状数组
    双重Hash
  • 原文地址:https://www.cnblogs.com/TheMiao/p/10663088.html
Copyright © 2011-2022 走看看