Open AlexCeg opened 1 month ago
The return value already handles if the insert should happen. Why do you call Rec.insert and return false? If you want to insert the record, just return true and if not, return false inside the trigger.
@dannoe It is just an easy example. If I insert the record return false I get an error because the return value is ignored and the standard tries to insert the record as well.
@AlexCeg I tried your code in a cloud sandbox with Version: DE Business Central 25.0 (Plattform 25.0.26191.0 + Anwendung 25.0.23364.24599) but i don't get a error. Do you have other apps installed?
Hi, I retried it. It works in one of the newest versions 25.1.25873.26550 but it definetely did not work in 25.0.23364.25738
It would be interesting to know the version with which this problem was solved. For us the bug does not appear any more so you can close this issue.
Please include the following with each issue:
1. Describe the bug I have an extension that inserts a record in the OnInsertTrigger of a page extension and returns false in this trigger. This does not work in BC25. The return ist ignored
2. To Reproduce
3. Expected behavior There should be no change.
4. Actual behavior An error occurrs which is quite dangerous when we bring our customers to BC25 because they are not able to create sales orders any more.
5. Versions:
Final Checklist
Please remember to do the following:
[x] Search the issue repository to ensure you are reporting a new issue
[x] Reproduce the issue after disabling all extensions except the AL Language extension
[x] Simplify your code around the issue to better isolate the problem