0

タイプ所有者の属性を入力するためのJavaの同等のコードを知っている人はいますか?

Owner owner = new Owner();
owner.type = EntityName.systemuser.ToString();
owner.Value = user.UserId;

所有者へのentityreferenceを使用して、空のGuidの問題を解決しました。しかし今私は打っています:

[ERROR] Invalid ownerIdType = 7

これは、上記のC#の2行目であるowneridtype属性に関連していると思いますが、現在のコードは次のとおりです。

OrganizationServiceStub.KeyValuePairOfstringanyType owneridtype = new OrganizationServiceStub.KeyValuePairOfstringanyType();
owneridtype.setKey("owneridtype");
OrganizationServiceStub.OptionSetValue owner2 = new OrganizationServiceStub.OptionSetValue();
owner2.setValue(Integer.parseInt("8"));
owneridtype.setValue(owner2);  
collection.addKeyValuePairOfstringanyType(owneridtype);  

OrganizationServiceStub.KeyValuePairOfstringanyType vendedor = new OrganizationServiceStub.KeyValuePairOfstringanyType();
vendedor.setKey("ownerid");
OrganizationServiceStub.Guid vendedorGuid = utils.readVendCrm(serviceStub,args[17]);
OrganizationServiceStub.EntityReference owner = new OrganizationServiceStub.EntityReference();
owner.setLogicalName("owner");
owner.setId(vendedorGuid);
vendedor.setValue(owner);
collection.addKeyValuePairOfstringanyType(vendedor);  
4

2 に答える 2

0

JavaとCRM2011についてはよくわかりませんが、恐れ入りますが、この記事は役立つかもしれません。

MicrosoftDynamicsCRM用のJavaおよびその他の非.NETクライアントアプリケーションを作成します

関連する質問:

于 2013-01-25T10:06:53.530 に答える
0

参照する必要がある正しいエンティティは、所有者ではなく systemuser です。これは私のエラーでした。正しいコードは次のとおりです。

    OrganizationServiceStub.KeyValuePairOfstringanyType vendedor = new OrganizationServiceStub.KeyValuePairOfstringanyType();
   vendedor.setKey("ownerid");
   OrganizationServiceStub.Guid vendedorGuid = utils.readVendCrm(serviceStub,args[17]);
   OrganizationServiceStub.EntityReference owner = new OrganizationServiceStub.EntityReference();
   owner.setLogicalName("systemuser");
   owner.setId(vendedorGuid);
   vendedor.setValue(owner);
   collection.addKeyValuePairOfstringanyType(vendedor);  
于 2013-01-29T16:40:49.313 に答える