Topic: Oracle Fusion

Adding an Email at Customer Contact Point using Webservice – Oracle Fusion 0

In the previous Post, we learnt how to create a Customer Contact Point for a Customer Account. In this post, we will look at the payload and process to assign or add an email to a Contact Point.

Like in the previous post, get the Party ID of the Contact and the RelationshipId between the Customer Account and the Customer Contact Point.

WSDL: https://<yourservername>.oraclecloud.com/crmService/FoundationPartiesPersonService?WSDL

Payload:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/applicationModule/types/" xmlns:per="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/" xmlns:par="http://xmlns.oracle.com/apps/cdm/foundation/parties/partyService/" xmlns:sour="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/sourceSystemRef/" xmlns:con="http://xmlns.oracle.com/apps/cdm/foundation/parties/contactPointService/" xmlns:con1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/contactPoint/" xmlns:par1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/partySite/" xmlns:per1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/person/" xmlns:rel="http://xmlns.oracle.com/apps/cdm/foundation/parties/relationshipService/" xmlns:org="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/orgContact/" xmlns:rel1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/relationship/">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:mergePerson>
         <typ:personParty>
            <!--PartyId of the Person/Contact-->
            <per:PartyId>3000000281613</per:PartyId>
            <per:Relationship>
               <!--RelationshipId created in the first request-->
               <rel:RelationshipId>3000000281613</rel:RelationshipId>
               <rel:Email>
                  <con:OwnerTableName>HZ_PARTIES</con:OwnerTableName>
                  <con:CreatedByModule>HZ_WS</con:CreatedByModule>
                  <con:ContactPointPurpose>BUSINESS</con:ContactPointPurpose>
                  <con:StartDate>2021-08-16</con:StartDate>
                  <!--EmailAddress of the Person/Contact-->
                  <con:EmailAddress>testemail@oracle.com</con:EmailAddress>
               </rel:Email>
            </per:Relationship>
         </typ:personParty>
      </typ:mergePerson>
   </soapenv:Body>
</soapenv:Envelope>

Create Customer Contact Point at Account Level using SOAP Webservice- Oracle Fusion 1

In the last Post, we have seen ways to create Customer Account and Customer Account Site using SOAP Webservices. In this post, we shall try to continue to use SOAP Webservices to create Customer Contact Point at Account level.

One thing we have to understand is that – a Contact Point is also an object in the TCA Architecture and thus, the Contact will also have a Party ID.

It took some time for me to get to this stage to understand the actual process to create a contact, and wanted to share. In short, we will follow the below steps:

  1. Create a Contact -> This will create a Party ID for the Contact Point.
  2. Take the Party ID of the Contact from the above step, and take the Party ID of the Customer Account to which we are trying to create the Contact Point for.
  3. Create a Relationship between the two Parties. Get the RelationshipId.
  4. Take the RelationshipId from the above step, take the Customer Account ID, and run the SOAP to create the Customer Contact Point.

Explained in detail below:

Step 1: Create Contact Point: First, we create a Person or Party for the Contact using the Payload below.

WSDL: https://<yourservername>.oraclecloud.com/crmService/FoundationPartiesPersonService?WSDL

Payload:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/applicationModule/types/" xmlns:per="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/" xmlns:par="http://xmlns.oracle.com/apps/cdm/foundation/parties/partyService/" xmlns:sour="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/sourceSystemRef/" xmlns:con="http://xmlns.oracle.com/apps/cdm/foundation/parties/contactPointService/" xmlns:con1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/contactPoint/" xmlns:par1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/partySite/" xmlns:per1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/person/" xmlns:rel="http://xmlns.oracle.com/apps/cdm/foundation/parties/relationshipService/" xmlns:org="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/orgContact/" xmlns:rel1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/relationship/">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:createPerson>
         <typ:personParty>
            <per:CreatedByModule>HZ_WS</per:CreatedByModule>
            <per:PersonProfile>
               <per:CreatedByModule>HZ_WS</per:CreatedByModule>
               <per:PersonFirstName>Test Contact</per:PersonFirstName>
               <per:PersonLastName>soap</per:PersonLastName>
            </per:PersonProfile>
            <per:PartyUsageAssignment>
               <par:PartyUsageCode>CONTACT</par:PartyUsageCode>
               <par:CreatedByModule>HZ_WS</par:CreatedByModule>
            </per:PartyUsageAssignment>
            <per:Phone>
               <con:OwnerTableName>HZ_PARTIES</con:OwnerTableName>
               <con:PhoneCountryCode>1</con:PhoneCountryCode>
               <con:PhoneNumber>987-654-3210</con:PhoneNumber>
               <con:PhoneLineType>GEN</con:PhoneLineType>
               <con:CreatedByModule>HZ_WS</con:CreatedByModule>
            </per:Phone>
            <per:Phone>
               <con:OwnerTableName>HZ_PARTIES</con:OwnerTableName>
               <con:PhoneCountryCode>1</con:PhoneCountryCode>
               <con:PhoneNumber>987-654-3212</con:PhoneNumber>
               <con:PhoneLineType>MOBILE</con:PhoneLineType>
               <con:CreatedByModule>HZ_WS</con:CreatedByModule>
            </per:Phone>            
         </typ:personParty>
      </typ:createPerson>
   </soapenv:Body>
</soapenv:Envelope>

After you run the payload, Copy the Party ID from the Response. Party ID = 300000030003058. This is the party ID of the Contact Point.

Step 2: Establishing a Relationship between the above created Contact and the Customer Account

First get the Party ID of the Customer to which this Contact Point is being assigned to using the following query:

select party_id from hz_cust_accounts where account_number = <account_number>     --> party_id = 100000001814997

WSDL: https://<yourservername>.oraclecloud.com/crmService/FoundationPartiesPersonService?WSDL

Payload:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/applicationModule/types/" xmlns:per="http://xmlns.oracle.com/apps/cdm/foundation/parties/personService/" xmlns:par="http://xmlns.oracle.com/apps/cdm/foundation/parties/partyService/" xmlns:sour="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/sourceSystemRef/" xmlns:con="http://xmlns.oracle.com/apps/cdm/foundation/parties/contactPointService/" xmlns:con1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/contactPoint/" xmlns:par1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/partySite/" xmlns:per1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/person/" xmlns:rel="http://xmlns.oracle.com/apps/cdm/foundation/parties/relationshipService/" xmlns:org="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/orgContact/" xmlns:rel1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/relationship/">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:mergePerson>
         <typ:personParty>
            <!--PartyId of the Person/Contact-->
            <per:PartyId>300000030003058</per:PartyId>
            <per:Relationship>
               <rel:SubjectType>PERSON</rel:SubjectType>
               <rel:SubjectTableName>HZ_PARTIES</rel:SubjectTableName>
               <!--PartyId of the Organization/Customer to which this Contact is being assigned to-->
               <rel:ObjectId>100000001814997</rel:ObjectId>
               <rel:ObjectType>ORGANIZATION</rel:ObjectType>
               <rel:ObjectTableName>HZ_PARTIES</rel:ObjectTableName>
               <rel:RelationshipCode>CONTACT_OF</rel:RelationshipCode>
               <rel:RelationshipType>CONTACT</rel:RelationshipType>
               <rel:CreatedByModule>HZ_WS</rel:CreatedByModule>
               <rel:OrganizationContact>
                  <rel:CreatedByModule>HZ_WS</rel:CreatedByModule>
                  <rel:PrimaryCustomerFlag>true</rel:PrimaryCustomerFlag>
               </rel:OrganizationContact>
            </per:Relationship>
         </typ:personParty>
      </typ:mergePerson>
   </soapenv:Body>
</soapenv:Envelope>

From the response – copy the RelationshipId. 3000000300495. This is the RelationshipID. This establishes a relation between the Contact Party ID and the Account Party ID.

Step3: Until now – we have created a Contact (above step1). And have established a Relationship between the Customer and Contact. Now we have to assign the Contact to the Account.

Get the Cust account Id of the customer using the query below

select cust_account_id from hz_cust_accounts where account_number = <account_number> –> cust_account_id = 1000000018717

WSDL: https://<yourservername>oraclecloud.com/crmService/CustomerAccountService?WSDL

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/customerAccountService/applicationModule/types/" xmlns:cus="http://xmlns.oracle.com/apps/cdm/foundation/parties/customerAccountService/" xmlns:cus1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccountContactRole/" xmlns:par="http://xmlns.oracle.com/apps/cdm/foundation/parties/partyService/" xmlns:sour="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/sourceSystemRef/" xmlns:cus2="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccountContact/" xmlns:cus3="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccountRel/" xmlns:cus4="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccountSiteUse/" xmlns:cus5="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccountSite/" xmlns:cus6="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccount/">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:mergeCustomerAccount>
         <typ:customerAccount>
            <!--CustomerAccountId for the Customer Account-->
            <cus:CustomerAccountId>1000000018717</cus:CustomerAccountId>
            <cus:CustomerAccountContact>
               <!--CustomerAccountId for the Customer Account-->
               <cus:CustomerAccountId>1000000018717</cus:CustomerAccountId>
               <cus:RoleType>CONTACT</cus:RoleType>
               <cus:CreatedByModule>HZ_WS</cus:CreatedByModule>
               <!--RelationshipId created in the first request-->
               <cus:RelationshipId>3000000300495</cus:RelationshipId>
            </cus:CustomerAccountContact>
         </typ:customerAccount>
      </typ:mergeCustomerAccount>
   </soapenv:Body>
</soapenv:Envelope>

Check the response of the webservice, and the Customer Account should have got created at the Customer Account level.

The same Customer Contact Point can also be created at the Customer Account Site Level. It needs an extra payload.

Create Customer Account, Site, Site Use using SOAP Webservice – Oracle Fusion 0

In the previous post, we have used REST API to create a Customer Organization that would create Party, Party Site, Party Site Usage and Location for an Organization. That post can be found here: http://oraclelabs.phaniadivi.com/2022/01/creating-a-party-or-organization-using-rest-api-oracle-fusion/

Note: An Organization / Party can be created using a REST API and a Customer account and Sites are created using SOAP Webservices.

In this Post, we will use a SOAP webservice to create Customer for an existing Party.

Of the Existing Party – Get the Party ID, Party Site ID from the BI Catalog by running the following queries:

select party_id from hz_parties where party_name = 'Oracle Learnings'; 

select party_site_id 
from hz_party_sites 
where party_id = (select party_id from hz_parties where party_name = 'Oracle Learning')

Using SOAP UI or other application run the following code:

WSDL: https://ehkm-test.fa.us6.oraclecloud.com/crmService/CustomerAccountService?WSDL

Payload:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/cdm/foundation/parties/customerAccountService/applicationModule/types/" xmlns:cus="http://xmlns.oracle.com/apps/cdm/foundation/parties/customerAccountService/" xmlns:cus1="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccountContactRole/" xmlns:par="http://xmlns.oracle.com/apps/cdm/foundation/parties/partyService/" xmlns:sour="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/sourceSystemRef/" xmlns:cus2="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccountContact/" xmlns:cus3="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccountRel/" xmlns:cus4="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccountSiteUse/" xmlns:cus5="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccountSite/" xmlns:cus6="http://xmlns.oracle.com/apps/cdm/foundation/parties/flex/custAccount/">
   <soapenv:Header/>
   <soapenv:Body>
      <typ:createCustomerAccount>
         <typ:customerAccount>
            <cus:PartyId>-- enter party id</cus:PartyId>
            <cus:AccountName>Customer Account Name</cus:AccountName>      
            <cus:AccountNumber>123456</cus:AccountNumber>
            <cus:CustomerType>R</cus:CustomerType>
            <cus:AccountEstablishedDate>2022-01-09</cus:AccountEstablishedDate>
            <cus:CreatedByModule>HZ_WS</cus:CreatedByModule>
            <cus:CustomerAccountSite>
               <cus:PartySiteId>-- enter party site id --</cus:PartySiteId>
               <cus:CreatedByModule>HZ_WS</cus:CreatedByModule>
               <cus:SetId>-- derive set id from configurations --</cus:SetId>
               <cus:StartDate>2022-01-09</cus:StartDate>
               <cus:CustomerAccountSiteUse>
                  <cus:SiteUseCode>BILL_TO</cus:SiteUseCode>
                  <cus:CreatedByModule>HZ_WS</cus:CreatedByModule>
               </cus:CustomerAccountSiteUse>
            </cus:CustomerAccountSite>
         </typ:customerAccount>
      </typ:createCustomerAccount>
   </soapenv:Body>
</soapenv:Envelope>

After the above code is run – check to see if the customer is created in the system or not using the following queries:

select * from hz_cust_accounts  -- get the account_number 

select * 
from hz_cust_acct_sites_all 
where cust_account_id = (select cust_account_id 
                           from hz_cust_accounts
                         where account_number = <account number>)

select * 
from hz_cust_site_uses_all
where CUST_ACCT_SITE_ID = (select CUST_ACCT_SITE_ID 
                           from hz_cust_acct_sites_all
                         where cust_account_id = (select cust_account_id 
                                                    from hz_cust_accounts
                                                     where account_number = <account number>))

Creating a Party or Organization using REST API – Oracle Fusion 0

In the next few posts, we will try to create the TCA hierarchy objects such as Organization, Party, Party Sites, Party Site Uses, Accounts, Account Sites, Contacts etc. using Webservice (and SOAP as a tool) .

Also, the FBDI process need to be used for large data imports like master conversion process and not for daily data integration with third party systems. For daily integrations, Webservices such as SOAP or REST need to be used.

After 20D release, Organizations will be created using REST API. Accounts, Sites, Site Usage, Profile will be created using SOAP Webservices.

In this post, we will see what is the data that is required to create a Party or Organization. Later we will run few queries to see the data created in Oracle Fusion.

Use POSTMAN or some other tool to run the following REST API.

Request URL: https://xxx-your-oracle.oraclecloud.com/crmRestApi/resources/11.13.18.05/hubOrganizations

Method: POST

Payload:

{
	   "PartyNumber":"9988770",
	   "SourceSystemReference":[
		  {
			 "SourceSystem":"FranSysCustom",
			 "SourceSystemReferenceValue":"9988770LCE"
		  }
	   ],
	   "OrganizationName":"Oracle Learnings",
	   "PartyUsageCode":"EXTERNAL_LEGAL_ENTITY",
	   "RawPhoneNumber":"9199199199",
	   "EmailAddress":"send_email@oracle.com",
	   "URL":"www.oracle.com",
	   "Address":[
		  {
			 "AddressType":"BILL_TO",
			 "Address1":"1234 Sample Address1",
			 "City":"Sample City",
			 "Country":"US",
			 "County":"Oakland",
			 "PostalCode":"94065",
			 "PostalPlus4Code":"",
			 "State":"NY"
		  }
	   ],
	   "CorpCurrencyCode":"USD",
	   "CurcyConvRateType":"Corporate",
	   "CurrencyCode":"USD",
	   "DUNSNumber":"123456789"
}

Upon running this, the response will have the Party ID and Party Site ID. You can use this Party ID to further create Accounts etc.

Queries:

select * from hz_parties where party_name = 'Oracle Learnings';
select * from hz_party_sites where party_id in (select party_id from hz_parties where party_name = 'Oracle Learnings');
select * 
from hz_party_site_uses 
where party_site_id in (select party_site_id 
                        from hz_party_sites 
                        where party_id in (select party_id from hz_parties where party_name = 'Oracle Learnings'))

select * 
from hz_locations 
where location_id in (select location_id from hz_party_sites where party_id in (select party_id from hz_parties where party_name = 'Oracle Learnings'))

And thus, your Organization / Party, Party Site, Party Site Use, Location is created with a single call to the REST API.

Update Receipt Method on AR Invoice 0

The following Webservice code can be used to Update Receipt Method on the AR Invoice. Some of the conditions that are required are that the Invoice need to be in Complete Status. The Complete button should be in enabled status. That is, if a receipt is applied on the invoice, then we cannot modify the Receipt Method on the Invoice.

Get the Customer Transaction ID for the Invoice using the following query:

select customer_trx_id from ra_customer_trx_all where trx_number = <ar_invoice_number>; 

WSDL used is: https://xxx-your-oracleserver.oraclecloud.com/fscmService/StandardReceiptService?WSDL

Code to update the Receipt Method is:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://xmlns.oracle.com/apps/financials/receivables/transactions/invoices/invoiceService/types/" xmlns:inv="http://xmlns.oracle.com/apps/financials/receivables/transactions/invoices/invoiceService/" xmlns:typ1="http://xmlns.oracle.com/adf/svc/types/">
<soapenv:Header/>
<soapenv:Body>
   <typ:processUpdateCCToken>
      <typ:changeOperation>Create</typ:changeOperation>
      <!--Zero or more repetitions:-->
      <typ:updateCCToken>
      <inv:CustomerTrxId>9999938381</inv:CustomerTrxId>
      <inv:ReceiptMethod>New Receipt Method Name</inv:ReceiptMethod>
   </typ:updateCCToken>
      <typ:processControl>
         <typ1:partialFailureAllowed>true</typ1:partialFailureAllowed>
      </typ:processControl>
   </typ:processUpdateCCToken>
</soapenv:Body>
</soapenv:Envelope>