有誰知道Java中的等效代碼來填充類型所有者的屬性嗎?從java中設置Microsoft Dynamics CRM類型所有者的屬性
Owner owner = new Owner();
owner.type = EntityName.systemuser.ToString();
owner.Value = user.UserId;
我已經使用了一個entityreference的所有者,並解決了空Guid的問題。但現在我打:
[ERROR] Invalid ownerIdType = 7
我認爲這是對owneridtype屬性,在上面的C#是第二行相關,米當前的代碼如下:
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);
java or javascript? –
Java,它是一個使用soap web服務的外部應用程序,而不是CRM內部的解決方案 –