I recently upgraded from CDS v3 to the latest v4 release ("@sap/cds": "^4.6.4").
I have a simple CDS entity definition:
entity NumberRange { key UUID : UUID; ID : String(60); Low : Integer; High : Integer; LastUsed : Integer; Length : Integer; Locked : Boolean; tenantID : UUID; }
Since I upgraded to v4, data is being wiped though my application after updating entitys. Here is one example:
//CDS v4 seems to require that I pass all fields of an entity or they are nulled.. //var oPayload = {}; //oPayload.UUID = uuid; //oPayload.ID = response.ID; //oPayload.Low = response.Low; //oPayload.High = response.High; //oPayload.Length = response.Length; //oPayload.tenantID = response.tenantID; //oPayload.LastUsed = parseInt(lastUsed); //CDS v3 Payload was able to update a single field var oPayload = {"UUID": uuid, "LastUsed": parseInt(lastUsed)}; var sURL = "/odata/v4/CatalogService/NumberRanges(" + uuid + ")"; //Update Last Used await this.axios.put(sURL, oPayload) .catch(function (err) { var error = err; });
Im I correct to assume that we should not have to populated every value in an object before updating?
SAP support has said that custom coding is a consulting request. Therefore, I would like to show the same issue with CDS 4.6.4 when updating an entity through postman: