A transaction must be started before changes are made on the Database? Updating a Page

Dear All,

I have a function in my page which update all my Price line. the button is working just fine.

Now I get a request which says that I have to update the lines each time the Page is Opened, I did the following:

this is my code;

**********************************************************

WITH PurchasePriseLoc DO BEGIN

  COPYFILTERS(Rec);

  IF FINDSET(TRUE,FALSE) THEN BEGIN

    REPEAT

        priceLoc := wMgtLoc.CalcWAP_EP("Item No.");

        VALIDATE("Direct Unit Cost", priceLoc);

        VALIDATE("UC3 (LCY)", wMgtLoc.CalcFreight_TariffOnWAP_EP(priceLoc, "Item No.", "Vendor No.", "Freight Surcharge Code", "Currency Code"));

        MODIFY;   // ----> THIS IS CAUSING ALL ERRORS

    UNTIL PurchasePriseLoc.NEXT = 0;

  END;

END;

CurrPage.UPDATE;

***************************************************

I tried to add it On Open Page teriger(), or in On after get rec() --------> All give me the same error which is "A transaction must be started before changes are made on the Database"

  • The Table in subtye of PurchasePriseLoc record variable is same as the Source table of the page in which the action button is placed?

Related