makeDraftCopy

open suspend fun makeDraftCopy(entity: EntityValue): EntityValue

See makeDraftCopy_(EntityValue, HttpHeaders, RequestOptions).

Return

(see linked method).

Parameters

entity

Entity parameter.


open suspend fun makeDraftCopy(entity: EntityValue, headers: HttpHeaders): EntityValue

See makeDraftCopy_(EntityValue, HttpHeaders, RequestOptions).

Return

(see linked method).

Parameters

entity

Entity parameter.

headers

Headers parameter.


open suspend fun makeDraftCopy(entity: EntityValue, headers: HttpHeaders, options: RequestOptions): EntityValue

Create a draft copy of an entity. If the draft copy is intended to be subsequently activated to update (edit) the original entity, use {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#forUpdate() EntityValue.forUpdate} or {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#forDeepUpdate(com.sap.cloud.mobile.kotlin.odata.PropertyPath...) EntityValue.forDeepUpdate} to indicate this. If the draft copy is intended to be subsequently activated to create a clone of the original entity, use {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#forCreate() EntityValue.forCreate} or {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#forDeepCreate(com.sap.cloud.mobile.kotlin.odata.PropertyPath...) EntityValue.forDeepCreate} to indicate this.

See Also:

{@link com.sap.cloud.mobile.kotlin.odata.DataServiceAsync#activateDraft_(com.sap.cloud.mobile.kotlin.odata.EntityValue, com.sap.cloud.mobile.kotlin.odata.http.HttpHeaders, com.sap.cloud.mobile.kotlin.odata.RequestOptions) DataServiceAsync.activateDraft}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#forCreate() EntityValue.forCreate}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#forUpdate() EntityValue.forUpdate}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#forDeepCreate(com.sap.cloud.mobile.kotlin.odata.PropertyPath...) EntityValue.forDeepCreate}, {@link com.sap.cloud.mobile.kotlin.odata.EntityValue#forDeepUpdate(com.sap.cloud.mobile.kotlin.odata.PropertyPath...) EntityValue.forDeepUpdate}.

Example using proxy classes:
open fun makeDraftCopyExample(): kotlin.Unit
{
    val service = this.healthService;
    var patient = this.selectPatient();
    patient = (service.makeDraftCopy(patient.forDeepUpdate(Patient.appointments)) as Patient);
    patient.address = "221B Baker Street";
    service.updateEntity(patient);
    service.loadProperty(Patient.appointments, patient);
    L119@
    for (appointment in patient.appointments)
    {
        appointment.dateTime = appointment.dateTime.plusDays(7);
        service.updateEntity(appointment);
    }
    // Some time later... Activate the draft copy of patient (and related appointments).
    patient = (service.activateDraft(patient.withDeepUpdate(Patient.appointments)) as Patient);
    // Some time later... Upload the update of patient (and deep-updated appointments).
    service.upload();
}

Return

Newly created draft copy of the original entity.

Parameters

entity

Original entity.

headers

Optional request-specific headers.

options

Optional request-specific options.