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 = fieldName
 12:                     };
 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 = true;
 19: 
 20:                         UpdateAttributeRequest uar = new UpdateAttributeRequest()
 21:                         {
 22:                             EntityName = entityName,
 23:                             Attribute = bam
 24:                         };
 25: 
 26:                         service.Execute(uar);
 27:                     }
 28:                 }

相关文章:

  • 2022-12-23
  • 2022-02-14
  • 2022-02-15
  • 2021-05-20
  • 2021-06-25
  • 2022-12-23
  • 2021-12-21
  • 2021-08-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-21
  • 2021-12-26
相关资源
相似解决方案