-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch API for Business Partner #5433
Comments
Conceptually you make the right calls, but it is hard to determine the core of your issue with the information you provided. Can you share:
|
Alternatively, you can try creating the entity on your own instead of passing a payload and see if you still receive errors, this would point at an erroneous payload. import { apiBusinessPartner } from "./generated/API_BUSINESS_PARTNER/service"
const { businessPartnerApi } = apiBusinessPartner()
const payload = businessPartnerApi.entityBuilder().build();
const updateResult = await businessPartnerApi
.requestBuilder()
.update(payload)
.execute({ destinationName: "MyDestination" }); |
hello @tomfrenken, thank you for your reply.
And here's the example payload that I send:
But if I create the entity that way, how do I pass the payload that contains the updated data to hit the patch API? |
Describe the Question
Hello,
So I followed the installation and generation steps in this documentation:
https://api.sap.com/api/API_BUSINESS_PARTNER/cloud-sdk/JavaScript
And I have imported the client to consume the service via the generated typed client library.
The get request was successful, but when I try to use the update function, I always get the
.getCustomFields is not a function
error message. And if I also include the date fields, it will throwmomentInstance.unix is not a function
error.I followed this documentation for the update implementation.
My code looks like this:
I tried building the entity first before sending the payload like this:
But the generated payload is an empty object.
The original payload before being built is obtained from the fiori app via
req.data
.Am I missing some steps or how do I use this
update
function?Thanks guys.
The text was updated successfully, but these errors were encountered: