X

Angelo Santagata's Blog

Adding a contact to a sales cloud account

Angelo Santagata
Architect

A common question is how do you add a contact to a Account in Sales Cloud? Ive seen developers (including me) try to issue a mergeOrganizaiton on the org, however this is not correct. In Oracle Fusion , Contacts are not "addded" to accounts but they are "related" to accounts.. Therefore to add a contact to a account you need to add a "Relationship" which links the contact and the organization. Here's a sample payload













WSDL<host>/crmCommonSalesParties/RelationshipService?wsdl

SOAP Request Payload



<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/crmCommon/salesParties/relationshipService/types/" xmlns:rel="http://xmlns.oracle.com/apps/crmCommon/salesParties/relationshipService/">


   <soapenv:Header/>

 <soapenv:Body>

      <typ:createRelationship>

         <typ:relationship>

<!-- ContactId -->

            <rel:ObjectPartyId>300000000943126</rel:ObjectPartyId>

<!-- AccountId -->

            <rel:SubjectPartyId>300000000943078</rel:SubjectPartyId>

            <rel:RelationshipType>CONTACT</rel:RelationshipType>

            <rel:RelationshipCode>CONTACT</rel:RelationshipCode>

            <rel:CreatedByModule>HZ_WS</rel:CreatedByModule>

            <rel:Status>A</rel:Status>

         </typ:relationship>

      </typ:createRelationship>

   </soapenv:Body>

</soapenv:Envelope>


Groovy Script Example









def addContact =

[

        ObjectPartyId        : '300000000943126', /*Contact */

        SubjectPartyId       : '300000000943078', /*Account */

        RelationshipType  : 'CONTACT',

        RelationshipCode  : 'CONTACT',

        CreatedByModule : 'HZ_WS',

        Status  : 'A'

];


adf.webServices.RelationshipService.createRelationship(addContact);



Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.