cancel
Showing results for 
Search instead for 
Did you mean: 

CAP: EDIT request became CREATE

01-22-2021 2:43 PM
alicegavanelli Participant
1154 views 2 comments Go to solution
SAP Managed Tags
Subscribe

Dear Experts,

I call an entity in order to edit some data, so I do a PUT request.

Entity key doesn't exist, so result expected is "Error: record doesn't exist" but the behavior is diffent.

EDIT request is converted in CREATE request and new record is insterted.

In CAP's change log documentation, I find this comment:

Is it possible to disable this behavior?

Maybe by configuration?

Best

Alice

Accepted Solutions (1)

Accepted Solutions (1)

vansyckel
Product and Topic Expert
Product and Topic Expert

Hi Alice,

Yes, you can by adding the following to your cds config.

Best,
Sebastian

runtime: {
  allow_upsert: false
}
alicegavanelli
Participant

Hi Sebastian,

this configuration works.

I have change file .cdsrc.json adding this property:

    "runtime": {
        "allow_upsert": false
    },

Best

Alice

Answers (0)