有谁知道Java中的等效代码来填写类型所有者的属性?
Owner owner = new Owner();
owner.type = EntityName.systemuser.ToString();
owner.Value = user.UserId;
我使用了对所有者的实体引用并解决了空 Guid 的问题。但现在我要打了:
[ERROR] Invalid ownerIdType = 7
我认为这与上面C#中第二行的owneridtype属性有关,m当前代码如下:
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);