Click or drag to resize

AdministrationClientCreateSecurityAccountForExistingEntity Method

Syntax
C#
public Result CreateSecurityAccountForExistingEntity(
	ManagementGroupRequestOfCreateSecurityAccountForExistingEntity request
)

Parameters

request
Type: AdministrationServiceManagementGroupRequestOfCreateSecurityAccountForExistingEntity

Return Value

Type: Result
Examples
C#
using (var svc = new AdministrationService.AdministrationClient())
{
  var request = new AdministrationService.ManagementGroupRequestOfCreateSecurityAccountForExistingEntity();
  request.Token = "Token";//Required - Token returned from AccountService.ManagementGroupLogin
  request.ManagementGroup = "Management group";//Required - ManagementGroup supplied when calling AccountService.ManagementGroupLogin

  var createSecurityAccountForExistingEntity = new AdministrationService.CreateSecurityAccountForExistingEntity();
  createSecurityAccountForExistingEntity.AccountName = "Account name"; //Required - Must be unique to each management group
  createSecurityAccountForExistingEntity.AccountOwner_RSN = new Guid("80061735-5a34-483f-9759-d3442ba2f585");; //Required - Member who will own the security account
  createSecurityAccountForExistingEntity.EmailAddress = "john.doe@simplicitycrm.com"; //Required - The email address to recieve activation requests and password reset requests
  createSecurityAccountForExistingEntity.ResetPasswordEmailTemplateID = "RESET_PASSWORD_REQUEST"; //Optional - if supplied, sends email to specified email address 

  var managementGroup = new AdministrationService.SecurityAccountManagementGroup();
  managementGroup.GroupCode = "LOYALTY_MEMBER";//Required        
  managementGroup.CanApproveTransactions = false;//Optional
  //all other managementGroup properties ignored
  createSecurityAccountForExistingEntity.ManagementGroups = new AdministrationService.SecurityAccountManagementGroup[] { managementGroup }; //Required - The management groups for the new account

  // add newSecurityAccount to request
  request.Value = createSecurityAccountForExistingEntity;

  AdministrationService.Result result = svc.CreateSecurityAccountForExistingEntity(request);

  if (result.FaultCode == 0)
  {
    //Request succeeded
  }
  else
  {
    //Request failed        
    throw new Exception(result.FaultDescription);
  }
}
See Also