首页 > 代码库 > CRM 2013 批量更新two options的缺省值
CRM 2013 批量更新two options的缺省值
1: string entNames = "new_print_plan,new_radio_plan,new_bill_board,new_tv_plan,new_btl_posm,new_btl_poe_fixed,new_promotion_girls,new_promotion_events,new_digital_plan";
2: string fieldNames = "new_actual_is_cancel,new_is_in_plan";
3: foreach (string entityName in entNames.Split(‘,‘))
4: {5: foreach (string fieldName in fieldNames.Split(‘,‘))
6: {7:8: RetrieveAttributeRequest rar = new RetrieveAttributeRequest()
9: {10: EntityLogicalName = entityName,11: LogicalName = fieldName12: };13:14: var am = (RetrieveAttributeResponse)service.Execute(rar);
15: if (am.AttributeMetadata.AttributeType == AttributeTypeCode.Boolean)16: {17: var bam = am.AttributeMetadata as BooleanAttributeMetadata;
18: bam.DefaultValue = http://www.mamicode.com/true;
19:20: UpdateAttributeRequest uar = new UpdateAttributeRequest()
21: {22: EntityName = entityName,23: Attribute = bam24: };25:26: service.Execute(uar);27: }28: }
CRM 2013 批量更新two options的缺省值
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。