Form - Table - Report Problem

I am runnng the follwing code from the “On Validate” section of a specific boolean field “Order Complete” on the Sales Header Form IF xRec.“Order Complete”=FALSE THEN BEGIN Slsord2.RESET; Slsord2.SETRANGE(“No.”,“No.”); IF CONFIRM(‘Do you want to print the Sales Acknowledgement ?’) THEN REPORT.RUNMODAL(REPORT::“Sales Acknowledgement -Interna”,FALSE,TRUE,Slsord2); END; The Report “Sales Acknowledgement -Interna” updates the field “No. Printed” on the Sales Header Table. I get the following error message when printing the report: “another User has modified the database …” and the Sales header boolean “Order Complete” reverts back to false. Any suggestions???

Hi, I am not sure, but did you try putting the ‘SELECTLATESTVERSION’ command after printing the report. I think this can solve your problem. Francis

Didn’t work got the same error message.

Try to use COMMIT when you update your field or update the field after the report

Still same error with the Commit function in either place.

Hi blauer After u run the report through the form write the following line of code…it should work!! CurrForm.UPDATE(FALSE); so ur code should look like this … … REPORT.RUNMODAL(REPORT::“Sales Acknowledgement -Interna”,FALSE,TRUE,Slsord2); CurrForm.UPDATE(FALSE); END; … … Regards Akshay

CurrForm.UPDATE(FALSE); solves the database error but how do I get the “Order Complete” button to be marked true when checked if the form does not update? thanks

Any one have any other suggestions? thanks

Get the record after the Report. Something like: REPORT.RUNMODAL(REPORT::“Sales Acknowledgement - Interna”,FALSE,TRUE,Slsord2); FIND; CurrForm.Update; END; Or GET(“Document Type”,“No.”) instead of the FIND

This code works: IF xRec.“Order Complete”=FALSE THEN BEGIN CurrForm.UPDATE; IF CONFIRM(‘Do you want to print the Sales Acknowledgement ?’) THEN BEGIN Slsord2.RESET; Slsord2.SETRANGE(“No.”,“No.”); REPORT.RUNMODAL(REPORT::“Sales Acknowledgement -Interna”,FALSE,TRUE,Slsord2); CurrForm.UPDATE(FALSE); END; END;