on ‎2020 Sep 30 9:07 PM
Hello,
Is it possible to get the Sales Order External ID using the C4C odata API?
I noticed that this is not exposed on the standard c4codataapi service.
I also tried to create a custom odata and expose the field from there, but I couldn't find it there either.
Best regards,
Michel Fernandes
Request clarification before answering.
Hi,
You can get the external ID of the sales order using odata API as follow:
1. Pass the order ID as filter to odata API and get Order entity URL:
https://my3XXXXX.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/CustomerOrderCollection?$filter=ID eq '9000000583'
2. Get Order UUID and form the following URL:
https://my3XXXXX.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/CustomerOrderCollection('<UUID>')
This should give your order's root node.
3. Using the URL from step 2, Navigate to "CustomerOrderBusinessTransactionDocumentReference" navigation property and filter for TypeCode as 2059 (Sales Order) and BusinessSystemID as Instance ID in Communication System for whom you try to fetch external ID.
https://my3XXXXX.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/CustomerOrderCollection('00163E7842081EEA91E40792C56B2C25')/CustomerOrderBusinessTransactionDocumentReference?$filter=(TypeCode eq '2059' and BusinessSystemID eq 'CDA_HE4')
Here CDA_HE4 is instance ID as shown:
From the response of this odata call you will get "ID" as the external system order ID.
Thanks
Saurabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saurabh,
Thanks for the quick response.
I did not know of such node available in odata. But the problem for us is that all we have from the sales order is the external ID, so we need to find a sales order filtering by the external ID.
I tried a similar approach from your answer using the following url:
https://my3XXXXX.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/CustomerOrderBusinessTransactionDocum... eq '2059' and ID eq '2028481340')
But apparently the ID property is not filterable or searchable.
Do you have any ideas on how we could search a quote using the external id in this case?
Best regards,
Michel Fernandes
Hello,
Since "ID" is not filterable in "CustomerOrderBusinessTransactionDocumentReferenceCollection" entity set hence you definitely can't filter the data just based on sales order external ID using standard offering.
however, you can give a try using a custom solution as follow:
1. Create an extension field for CustomerQuote BO OR via KUT.
2. Using Odata Extention (for SDK) or Using "Services" tab (in KUT), extend the field usage for c4codataapi.
3. Fill the field created with the Sales Order External ID using AfterModify or BeforeSave script in SDK.
4. Now your field should be filterable using external ID in odata API. Hence you should be able to filter the data based on following URL:
https://my3XXXXX.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/CustomerOrderBusinessTransactionDocum... eq '2059' and ZZ_ExtID_SDK eq '2028481340')
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.