d.bernaert Posted June 23, 2020 Posted June 23, 2020 Hi, I'm facing a rather big issue. I've received a complaint of a big customer that when changing the price and quantity in the orders, prices are not calculated correctly anymore. I use a row editor in unidbgrid and have an event beforepost on the dataset that calculates the price of the line. The event is not called anymore in the latest version of Unigui. Has something changed here? I need to check with another dataset type as I also upgraded my IbDac components to be 10.4 compatible but if it's a Unigui issue, please look at it urgently because I'm having a few angry customers for the moment. Thx, Dominique Quote
Administrators Farshad Mohajeri Posted June 23, 2020 Administrators Posted June 23, 2020 Hi, BeforePost is a DataSet event. It will be fired before data is post. RowEditor posts data to the dataset only when "Confirm" button is pressed. Quote
d.bernaert Posted June 23, 2020 Author Posted June 23, 2020 Okay, but when pressing confirm the beforepost of the dataset attached to the grid is not fired. Dominique Quote
Administrators Farshad Mohajeri Posted June 23, 2020 Administrators Posted June 23, 2020 Can you observe this behavior in your local tests? Quote
d.bernaert Posted June 23, 2020 Author Posted June 23, 2020 I will try to create a small testcase Farshad. Quote
Administrators Farshad Mohajeri Posted June 23, 2020 Administrators Posted June 23, 2020 7 minutes ago, d.bernaert said: I will try to create a small testcase Farshad. Great! Quote
d.bernaert Posted June 23, 2020 Author Posted June 23, 2020 Here you can see the behavior. First click on save fires the event (gets back to the breakpoint). Send edit fires nothing, third fires again. Dominique Screen Recording 2020-06-23 at 19.52.00.mp4 Quote
Administrators Farshad Mohajeri Posted June 23, 2020 Administrators Posted June 23, 2020 Can you reduce this to a simple test app? My tests on our demo app seems to be OK! Quote
d.bernaert Posted June 24, 2020 Author Posted June 24, 2020 Hi Farshad, I've found the cause. Here included you can find a simple sample application. It seems there is a problem with using OnFieldImage. This sample uses a firedac memory dataset and calculates the total amount in the beforepost. When the code in OnFieldImage is enabled, 1 out of 2 times the beforepost is not called. When the code is disabled, the beforepost is always called. Could you please take a look at this? Thx, Dominique TestOnPost.zip Quote
Administrators Farshad Mohajeri Posted June 24, 2020 Administrators Posted June 24, 2020 OK I will check. Thanks Quote
Administrators Farshad Mohajeri Posted June 24, 2020 Administrators Posted June 24, 2020 Yes, there is a problem here. Here is a quick workaround which you can apply: In file uniDBGrid.pas please comment below 2 lines: if (not GridEditable) or xCol.ReadOnly then // avoid hacking attempts Exit; Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.