editable - Check value in db before saving edit to avoid overwriting other edits

(4 posts) (2 voices)

Tags:

  1. john, Member

    Trying to accomodate mutple users editing the same feild and overwriting each others edits. I Thought a quick way to do this would be to compare the original value of the feild on the report (could be date/int/long text) to the current value in db prior to saving the edit. I don't see the original value passed though.
    Do you have any suggestions ?

    I checked out this page but didn't see anything helpful, honestly i didn't look in the demos, sorry, but did do a google search on the forums.
    http://mydbr.com/doc/content/start.editable.html

  2. john, Member

    Just noticed the Javascript delete a row example that might work. still not sure where i would find the original value. Or mabye there is another way i could implement.

    I guess to clarify my goal it should be, to ensure the value in the report displayed to user is the same as the value in the database before saving the edit using inline editing of date/longtext/int values. validation can be before and asume edit is instant, or when submitting edit (preferred).

  3. john, Member

    I seem to have passed the original value in this post previously by inputing it as an second value in dbr.editable. link

    I added a second value to mydbr.editable, and also to the update procedure and ran the report and received this error from my dbr. (invalue was the second input in procedure and before this change would receive the new value)Edit report 'sp_DBR_update_NetworkNumber' requires parameter 'invalue', which was not supplied. Column 0 will not be editable. sorry that was a missing comma.

    It works by passing another value in the select 'dbr.editable'. and adding that parameter to the update procedure. Note invalue seems to be the name assigned to the new value passed to the update procedure by mydbr.
    still todo
    1. i need to read up on how to update/interact with the user as i haven't done that before.
    2. as it can be a long text feild they are editing i would like to give them a way to get the edited data before it is discarded, a popup report would work but not sure i can call that from a update proceudre......
    3. also would be cool to load the current data from db to the field they just edited so they don't need to reload the whole report to get the current data.

  4. myDBR Team, Key Master

    myDBR uses the last parameter automatically to pass the edited value to the editing procedure (the parameter name does not have to be inValue, you can name it whatever you like).

    You can use editable callback-function to return values from the database to the user.

    --
    myDBR Team


Reply

You must log in to post.