How to write code for cancel button to undo/rollback add and update a row in progress 4gl

Discussão em 'StackOverflow' iniciado por fdantas, Setembro 26, 2016.

  1. fdantas

    fdantas Administrator Moderador

    I have written a simple code to search some data's from the database and display it in the browser (br1) , it contains the following layout screenshot

    DO:
    Enable
    oadd oupdate odelete ocancel with frame default-frame.

    Find First Customer where Customer.Cust-Num =input oCustNum exclusive-lock NO-ERROR .

    if available customer

    THEN DO:

    message "1" view-as alert-box.

    update
    Customer.Name = input oName
    Customer.Balance = input oBalance
    Customer.Discount = input oDiscount
    Customer.Credit-Limit = input oCredit-Limit
    Customer.Phone = input oPhone
    Customer.Contact = input oContact .

    br1:refresh().
    end.

    if not available customer

    THEN DO:

    message "2" view-as alert-box.
    Create Customer.

    assign
    Customer.Cust-Num = input oCustNum
    Customer.Name = input oName
    Customer.Balance = input oBalance
    Customer.Discount = input oDiscount
    Customer.Credit-Limit = input oCredit-Limit
    Customer.Phone = input oPhone
    Customer.Contact = input oContact .

    end.
    END.


    i have written the code of save update and add in save button.

    now when the cancel button is pressed i need to undo / rollback the data's to the original value before add/update is done.

    could anyone help me please?

    Continue reading...

Compartilhe esta Página