cancel
Showing results for 
Search instead for 
Did you mean: 

[C4C] OData Search Internal Sales Order ID from External ID

tokgozatakan
Participant
0 Kudos

In the CustomerOrderCollection of c4codataapi, there's no ExternalID field avaliable.

Normally to get the ExternalID from the InternalID we use Business Transaction Reference Collection. But when we try to do the reverse; searching internal ID by external ID we receive the error below.

Is there any other standard way? I saw an answer recommending to have a KUT field then enchancing it with PDI but there should be another standard way I think.

Accepted Solutions (1)

Accepted Solutions (1)

former_member226
Employee
Employee
0 Kudos

Hello,

As part of CustomerOrderBusinessTransactionDocumentReference in c4codataapi, field ID is marked as "filtetrable=false" therefore you will not be able to query the Sales Order ID based on the External ID of the customer quote. odata.png

However there are still few other ways to deal with it:

1. As you mentioned about using a PDI extension field and query based on it. I would not prefer this as it requires coding and SDK usage.

2. You can create a new OData(Administrator-->OData Service Explorer) based on CustomerQuote Root node. Here you can include the BusinessTransactionDocumentReference node where ID will be marked as filterable. Save and Activate, Now you should be able to query the data without even a single line of code and no SDK involvement.

newodata.png.

newodatametadata.png

https://my3XXXXX.crm.ondemand.com/sap/c4c/odata/cust/v1/orderext/CustomerQuoteBusinessTransactionDoc...

BR

tokgozatakan
Participant

Hello saurabh.kabra,

Thanks for the recommendation, I've built the custom OData service. Developers weren't exactly pleased to use an additional service but still our problem has been resolved.

For anyone interested here are the detailed steps.

  • Create a custom OData Service from Service Explorer
  • Choose CustomerQuote as Business Object. Although it says Quote, it works for both Orders & Quotes. Choose Node as Business Transaction Reference. Since I only need to convert External ID to Internal ID I don't need any other node.
  • I selected the fields in the screenshot below. I renamed ID fields as Internal & External ID so that it wouldn't be confusing.

  • Using the link below I filtered TypeCode and the External ID. TypeCode is Sales Orders

https://my3xxxxxx.crm.ondemand.com/sap/c4c/odata/cust/v1/orderbtdreference/OrderBusinessTransactionD... eq '2059' and ExternalID eq '1855641'

Answers (0)