关于CRM2011插件注册更改记录状态的消息
View Code
1 public override void CustomerExecute(IServiceProvider serviceProvider) 2 { 3 4 if(Context.MessageName==MessageName.SetStateDynamicEntity.ToString() && ( 5 Context.PrimaryEntityName==EntityName.new_opportunity.ToString() 6 || Context.PrimaryEntityName == EntityName.new_retrocession.ToString() 7 || Context.PrimaryEntityName == EntityName.new_facultativere.ToString())) 8 { 9 EntityReference target = (EntityReference)Context.InputParameters["EntityMoniker"]; 10 OptionSetValue state = (OptionSetValue)Context.InputParameters["State"]; 11 OptionSetValue status = (OptionSetValue)Context.InputParameters["Status"]; 12 //int statecode = 1; 13 // 14 15 if (state.Value == (int)GoalState.Inactive) 16 { 17 if (Context.PrimaryEntityName == EntityName.new_opportunity.ToString()) 18 { 19 UpdateNew_facultativere(target, new_systemuser_new_opportunity_id, "关闭商机"); 20 } 21 if (Context.PrimaryEntityName == EntityName.new_facultativere.ToString()) 22 { 23 UpdateNew_facultativere(target, new_systemuser_new_facultativere_id, "关闭临分单"); 24 } 25 26 CloseSubRecord(target, Service, AdminService); 27 } 28 29 30 31 } 32 }
posted on 2012-07-24 18:10 HelloHongfu 阅读(221) 评论(0) 编辑 收藏 举报