on 10-30-2018 4:15 AM
Dear experts,
After creating new custom BO and its Odata service, now I want to do some checking before create new BO in Odata.
If A already exists in system(check field A, field B and field C), I will update it and otherwise I will create new BO.
With Post method, system always create new item I don't know how to check exist to update it
With Put method, it required to pass ObjectID to update that record but ObjectID is generated by Odata, I don't want external system to store it.
Could you please give me your advice? Thanks a lot for your help!
Regards,
Huy-Nguyen
Hi Vignesh,
Thanks a lot for your suggestion. That means this requirement cannot be done in server side, right?
Regards,
Huy-Nguyen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Huy-Nguyen,
Not all can be implemented in Server side for your requirement.
The solution I proposed is one of the approach we can take to get the solution, with that approach you dont have to store the ObjectID in other system also , because in the step one (GET request) you will get the ObjectID to pass in the PATCH method to update the record.
Regards,
Vignesh
Hi Huy-Nguyen,
It should be a client side logic.
It can be implemented in the client (Java, C#, C4C ABSL or any program capable of doing a REST call) which is calling the C4C OData Service.
Sample algorithm in client side should be as below:
1) Use GET method ($filter parameter) to check if an instance with (check field A, field B and field C) exists
2) If an instance with the check exists, use PATCH method to update the instance with the Object ID returned in the step 1
3) If the instance check in the step 1 failed, Use POST method with necessary payload to create new instance of the BO
Regards,
Vignesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.