If multi-update partly failed what I have to return from server?

If multi-update partly failed what I have to return from server?

VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0

Let's say if I update 5 records: 3 successful and 2 unsuccessful, what format of record-set should be returned from server?
I.e. how to combine:

{
    "data": [
        {
            "DT_RowId":   "row_29",
            "first_name": "Fiona",
            "last_name":  "Green",
            "position":   "Chief Operating Officer (COO)",
            "office":     "San Francisco",
            "extn":       "2947",
            "salary":     "850000",
            "start_date": "2010-03-11"
        }
    ]
}

and

{
    "fieldErrors": [
        {
            "name":   "first_name",
            "status": "This field is required"
        },
        {
            "name":   "last_name",
            "status": "This field is required"
        }
    ]
}

This question has an accepted answers - jump to answer

Answers

  • VyacheslavVyacheslav Posts: 70Questions: 27Answers: 0
    edited November 2015

    The same question for multi-delete as well.

  • jLinuxjLinux Posts: 981Questions: 73Answers: 75

    I dont use editor, but I would think there was a way to specify which ones were completed, and dont have DT update the failed rows.

    Either way, im curious about this one as well

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    The approach the Editor libraries take is two fold:

    1. Validate first (before anything is added) - so it can be thrown back if required.
    2. The database actions are wrapped in a transaction so if something does go wrong part way through the changes are rolled back and the error returned to the client.

    There is currently no way in Editor to be partly successful. Its all or nothing :-)

    Allan

This discussion has been closed.