Monday, July 27, 2015

Assign Team Using Create/Update Operation

Hi Team,

Please Use Below Code to Assign Team using Create/Update operation in Plugins

//Assign a record to a team
 private void AssignRecord(Entity TargetEntity, Guid TargetRecordID, Guid OwningTeamID, IOrganizationService orgService)
 {
     try
     {
         // Create the Request Object and Set the Request Object's Properties
         AssignRequest assign = new AssignRequest
         {
             Assignee = new EntityReference("team", OwningTeamID),
             Target = new EntityReference(TargetEntity.LogicalName, TargetRecordID)
         };
 
         // Execute the Request
         orgService.Execute(assign);
     }
     catch (Exception ex)
     {
         throw new Exception("An error occured while assinging Team to a record." + ex.Message);
     }
 }

No comments:

Post a Comment

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...