本站创建于2006年,博主为Delphi老码农,暗黑忠实粉丝,主要用于学习经验分享
    • CRM中代码自动共享

    • // Create the SecurityPrincipal Object
          SecurityPrincipal principal = new SecurityPrincipal();
          principal.Type = SecurityPrincipalType.User;

          // PrincipalId is the Guid of the user to whom access is being granted
          // SDK:principal.PrincipalId = new Guid("7B222F98-F48A-4AED-9D09-77A19CB6EE82");
          principal.PrincipalId = otherUserId;

          // Create the PrincipalAccess Object
          PrincipalAccess principalAccess = new PrincipalAccess();

          // Set the PrincipalAccess Object's Properties
          principalAccess.Principal = principal;

          // Gives the principal access to read
          principalAccess.AccessMask = AccessRights.ReadAccess;
         
          // Create the Target Object for the Request
          TargetOwnedAccount target = new TargetOwnedAccount();

          // EntityId is the Guid of the account access is being granted to
          // SDK:target.EntityId = new Guid("6A92D3AE-A9C9-4E44-9FA6-F3D5643753C1");
          target.EntityId = created.id;

          // Create the Request Object
          GrantAccessRequest grant = new GrantAccessRequest();

          // Set the Request Object's properties
          grant.PrincipalAccess = principalAccess;
          grant.Target = target;

          // Execute the Request
          GrantAccessResponse granted = (GrantAccessResponse)service.Execute(grant);

      标签: mscrm, 共享

    • 仅有一条评论 »

      diyivod

      diyivod December 27th, 2010 at 02:34 pm

      #1

      不错,我学习了,谢谢分享

      • 发表评论: ( 注意:为了防止广告评论,本站链接已经启用nofollow)
      •   您的名字
      •   E-mail
      •   您的网址(选填)

Powered by Typecho)))   ICP:蜀ICP备05009250号