public void Process(SetSystemCrmPropertyArgs args) { var stateProperty = GetStateProperty(args); if (stateProperty != null) { var statuscode = args["statuscode"]; var request = new SetStateDynamicEntityRequest { Entity = new Moniker { Id = args.EntityId, Name = args.EntityName }, Status = GetStatusValue((StatusProperty)statuscode), State = ((StateProperty)stateProperty).Value, }; CrmGate.Instance.Execute(request); } }
public ICrmAttribute GetStateProperty(SetSystemCrmPropertyArgs args) { return(args["statecode"] ?? args.Entity.Attributes["statecode"]); }