on ‎2020 Aug 10 8:02 PM
Hi Folks ,
I need to create multiplue items in existing Opportunity using Odata in SAP C4C.
It would be very great if some one please provide solution with example.
Regards,
Sunny
Request clarification before answering.
Hi Saurabh ,
Thanks for your reply ,
You are right we can do it by $batch option in post method that is one of the option(alternative).
I have created multiple items in existing service request in one of my project long back.
Please check the below payload but somehow it is not working right now. If we can create one item in existing opportunity or then why we can do it with multiple item.
Create request with multiple item in new ticket
UrL
Post Request https://myxxxxxx.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/ServiceRequestCollection
{ "ProcessingTypeCode":"###", "Name": "Testing for Postman",
"ServiceRequestItem" :
[
{ "ID":"10",
"ProductID":"IDdata"
},
{ "ID":"20",
"ProductID": "IDdata"
}
]
}
Create items records in existing Ticket
Post Request
https://myXXXXXX.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/ServiceRequestCollection('001XXX3E64DDBB1ED8XXXXXXXXX')
{ "CustomFields": "10",
"ServiceRequestItem":
[
{ "ID":"10", "ProductID":"100000", },
{ "ID":"20", "ProductID":"100001", }
]
}
like wise we can do it with opportunitycollection
Regards,
Sunny
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
There could be multiple explanations for the above-said behavior:
1. ServiceRequest and Opportunity both are using different BO and hence different implementation for their respective odatas. hence it is not necessary if ServiceRequestCollection offers something then it will also be available for opportunity collection. Whatever is written is odata guide has to be followed as this guide is prepared by expert/developers.
2. If something was working earlier but not working anymore then it has to be raised as a bug to SAP support for a fix. Can you please do that? In general with each new release whatever feature comes up, then they are also backward compatible, and if not then SAP usually informs them in webinars. I believe payload which you shared could have been from c4codata (v1 api) instead of c4codataapi (v2 API) , and this could be the reason for the same
Hi,
Pls have a look at official odata documentation at the following link:
Here you should be able to find about the same under the title"Create New OpportunityItem".
Further you cannot add multiple products in a single call to opportunity, hence you need to make a POST call either for each opportunity item one by one or using $batch end point as mentioned here: https://answers.sap.com/questions/13102793/add-multiple-products-to-an-opportunity-using-sap.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 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.