1
public
void
CreateEntity(ICrmService service)
2 {
3 // variable initialization
4 DynamicEntity entity = new DynamicEntity(); // target entity to update
5 TargetCreateDynamic targetCreate = new TargetCreateDynamic(); // used to update entity
6 CreateRequest createRequest = new CreateRequest(); // request to create entity
7
8 entity.Name = < entity name >
9
10 // add the properties
11 entity.Properties.Add( < property > );
12 Entity.Properties.Add( < property > );
13
14 // set the target to update, and the request to update for
15 targetCreate.Entity = entity;
16 createRequest.Target = targetCreate;
17
18 // execute the update request
19 service.Execute(createRequest);
20 }
2 {
3 // variable initialization
4 DynamicEntity entity = new DynamicEntity(); // target entity to update
5 TargetCreateDynamic targetCreate = new TargetCreateDynamic(); // used to update entity
6 CreateRequest createRequest = new CreateRequest(); // request to create entity
7
8 entity.Name = < entity name >
9
10 // add the properties
11 entity.Properties.Add( < property > );
12 Entity.Properties.Add( < property > );
13
14 // set the target to update, and the request to update for
15 targetCreate.Entity = entity;
16 createRequest.Target = targetCreate;
17
18 // execute the update request
19 service.Execute(createRequest);
20 }
参看:http://www.igooya.cn/bbs/viewthread.php?tid=470&extra=page%3D1