2015-01-07 3 views
0

SDK 용이 아닌 Ms Dynamics 통합 패키지를 다운로드했습니다. 모든 항목을 생성, 업데이트 및 삭제할 수 있습니다. 하지만 지금은 Java를 사용하여 Ms Dynamics Crm의 두 연락처를 병합하려고합니다. 연구는 나를 아무데도 이끌지 못했습니다. MergeRequest와 같은 클래스는 JavaScript를 위해 존재하지만 Java로 어떻게 움직일 지 확신하지 못합니다. 두 연락처를 만들고 검색했습니다.Ms dynamics는 Java를 사용하여 두 레코드를 병합합니다.

답변

0

CRUD 작업에 SOAP을 사용한다고 생각합니다. 여기에 비누 레코드의 병합입니다 : 물론

POST https://pactest.api.crm.dynamics.com/XRMServices/2011/Organization.svc/web 
Content-Type: text/xml; charset=utf-8 
SOAPAction: http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute 

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
    <s:Body> 
    <Execute xmlns="http://schemas.microsoft.com/xrm/2011/Contracts/Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> 
     <request i:type="b:MergeRequest" xmlns:a="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:b="http://schemas.microsoft.com/crm/2011/Contracts"> 
     <a:Parameters xmlns:c="http://schemas.datacontract.org/2004/07/System.Collections.Generic"> 
      <a:KeyValuePairOfstringanyType> 
      <c:key>Target</c:key> 
      <c:value i:type="a:EntityReference"> 
       <a:Id>00000000-0000-0000-0000-000000000000</a:Id> 
       <a:LogicalName>account</a:LogicalName> 
       <a:Name i:nil="true" /> 
      </c:value> 
      </a:KeyValuePairOfstringanyType> 
      <a:KeyValuePairOfstringanyType> 
      <c:key>SubordinateId</c:key> 
      <c:value i:type="d:guid" xmlns:d="http://schemas.microsoft.com/2003/10/Serialization/">00000000-0000-0000-0000-000000000000</c:value> 
      </a:KeyValuePairOfstringanyType> 
      <a:KeyValuePairOfstringanyType> 
      <c:key>UpdateContent</c:key> 
      <c:value i:type="a:Entity"> 
       <a:Attributes /> 
       <a:EntityState i:nil="true" /> 
       <a:FormattedValues /> 
       <a:Id>00000000-0000-0000-0000-000000000000</a:Id> 
       <a:LogicalName>account</a:LogicalName> 
       <a:RelatedEntities /> 
      </c:value> 
      </a:KeyValuePairOfstringanyType> 
      <a:KeyValuePairOfstringanyType> 
      <c:key>PerformParentingChecks</c:key> 
      <c:value i:type="d:boolean" xmlns:d="http://www.w3.org/2001/XMLSchema">true</c:value> 
      </a:KeyValuePairOfstringanyType> 
     </a:Parameters> 
     <a:RequestId i:nil="true" /> 
     <a:RequestName>Merge</a:RequestName> 
     </request> 
    </Execute> 
    </s:Body> 
</s:Envelope> 

당신은 병합 할 레코드의 올바른 ID를 가진 Guid.Empty를 교체해야합니다.

+0

프로세스를 좀 더 객체 지향적으로 만들기 위해 모든 엔티티를 클래스로 만들었습니다. 내 물건과 업데이트로 같은 요청을 모의하려고 노력할 것이다. 응답 해 주셔서 감사합니다. – Arjun

+0

이 경우 두 계정을 병합 할 때 어떤 매개 변수가 변경되어 우승 한 필드를 수정합니까? 예를 들어, 잃어버린 계정의 한 필드를 유지할 수 있습니까? – Arjun

관련 문제