AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
DAX
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 13.10.2009, 19:06   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
CRM Programmer: Update a number of custom attributes of DynamicEntity with TargetUpdateDynamic.
Источник: http://crmpro.blogspot.com/2009/10/u...erties-of.html
==============

This code I was used in plugins for updating the custom attributes using Microsoft.Crm.SDK.

using System;
using System.Collections.Generic;
using System.Collections;

// Microsoft Dynamics CRM namespaces
using Microsoft.Crm.Sdk;
using Microsoft.Crm.Sdk.Query;
using Microsoft.Crm.SdkTypeProxy;

...

// Extract the DynamicEntity from the request.
entity = (DynamicEntity)retrieved.BusinessEntity;

// declare a property array
ArrayList arrProps = new ArrayList();

// create some property
CrmBooleanProperty new_withindustry = new CrmBooleanProperty();
new_withindustry.Name="new_withindustry";
new_withindustry.Value= new CrmBoolean();
new_withindustry.Value.Value=true;
arrProps.Add(new_withindustry);

// create another property
CrmMoneyProperty new_industrydeal = new CrmMoneyProperty();
new_industrydeal.Name = "new_industrydeal";
new_industrydeal.Value = new CrmMoney();
new_industrydeal.Value.Value = 12345.0m;
arrProps.Add(new_industrydeal);

// Update the properties array on the DynamicEntity.
entity.Properties.AddRange((Property[])arrProps.ToArray(typeof(Property)));

// Create the update target.
TargetUpdateDynamic updateDynamic = new TargetUpdateDynamic();

// Set the properties of the target.
updateDynamic.Entity = entity;

// Create the update request object.
UpdateRequest update = new UpdateRequest();

// Set request properties.
update.Target = updateDynamic;

// Execute the request.
UpdateResponse updated = (UpdateResponse)crmService.Execute(update);



Источник: http://crmpro.blogspot.com/2009/10/u...erties-of.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
CRM DE LA CREME! Microsoft CRM 4.0 Update Rollup Best Practices Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05
CRM DE LA CREME! Configuring Microsoft Dynamics CRM 4.0 for Internet-facing deployment Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05
Microsoft Dynamics CRM Team Blog: Update Rollup 2 for Microsoft Dynamics CRM 4.0 - More Info Blog bot Dynamics CRM: Blogs 0 12.02.2009 13:05
Microsoft Dynamics CRM Team Blog: List Web Part for Microsoft Dynamics CRM 4.0 Deployment Scenarios Blog bot Dynamics CRM: Blogs 0 30.01.2009 22:05
Microsoft Dynamics CRM Team Blog: Update Rollup 2 for Microsoft Dynamics CRM 4.0 Blog bot Dynamics CRM: Blogs 0 20.01.2009 21:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 03:27.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.