Problem when BindingSource.RemoveCurrent()

Posted by Froy on 14-Jun-2010 07:03

Hello,

I've got a problem about my "DeleteRow" method.

What happens? Actually, after the method is called, one row is deleted but after 5 seconds we can get a message like this "no records in the Temp-Table ttCamion".

As for the DeleteCamion method, it just deletes the precise row thanks to the Id.

thanks for your help .

METHOD PUBLIC VOID DeleteRow( ):
        DEFINE VARIABLE idCam  AS INTEGER NO-UNDO.
        DEFINE VARIABLE hQuery AS HANDLE  NO-UNDO.
        camionClGpds:SetTrackingChange("ttCamion", TRUE).
        idCam = hdsCamion:GET-BUFFER-HANDLE():BUFFER-FIELD("IdCam"):BUFFER-VALUE ().
        /*        MESSAGE "avant remove"*/
        /*        VIEW-AS ALERT-BOX.*/
        /*        MESSAGE "après remove"*/
        /*        VIEW-AS ALERT-BOX.*/
        hQuery = THIS-OBJECT:GetCurrentQuery().
        bsCamion:RemoveCurrent().
        camionClGpds:DeleteCamion(STRING(idCam)).
        hQuery:DELETE-RESULT-LIST-ENTRY ().
        THIS-OBJECT:Sauver().
        RETURN.
               
    END METHOD.

All Replies

Posted by jquerijero on 08-Jul-2010 17:09

Try removing the call to RemoveCurrent(), and add bsCamion:Refresh() after DELETE-RESULT-LIST-ENTRY.

Posted by Admin on 08-Jul-2010 17:19

Where is the call to actually delete a record in the original sample? I see a call that probably enables TRACKING-CHANGES, but no actual deletion of a record.

This thread is closed