I'm having an issue with the RTC that has me banging my head against the wall. I have a list-type form that opens up with a filtered view (basically a subtable from the Resource Card). If I open it up and have records showing in the list, I can delete them with no problem. The list shows them disappearing. I close the page. I then go back in through the same link from the Resource Card, and the records are still there! It's like the delete never committed. Is there something special I need to do here?
And there is no temporary table or anything fancy here. It's a simple RunObject action link that opens the page filtered for records for the current resource from the resource list/card pages. In the classic client, I can delete the records with no problems...it's just in the RTC that I've hit this.
I'm wondering if this was an issue at one time that may have been corrected through a hotfix I'm missing? Let me know if any of you have seen this behaviour.
0
Comments
EDIT: yes, also check if the OnDeleteRecord trigger has a FALSE return value (but i assume that this code can be included in the "fancy" things, that are not in your page, you said. )
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
1. Deleting
- I delete a record from the list page in the RTC
- The record disappears
- If I close the page and come back in, or if I press F5 to refresh, the record shows again
2. Inserting
- My page is opened with a filter on Resource No. (to match the value from the card)
- I insert a new record in the list (it populates the Resource no. correctly)
- I move off the row and the new line disappears
- I press F5 to refresh, then I can see the new line fine (it inserted into the DB correctly)
I'm thinking of submitting this issue to microsoft, but wanted to see if I got any feedback here first.
http://www.epimatic.com
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
http://www.epimatic.com
P.S.: your build no. is the very first that has been released.
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
http://www.epimatic.com
try this link, if someone knows a better link, he's welcome... (this is an hotfix, and it specifically solve the problem described in the link. this is the one i have installed)
here, instead, you can find all platform hotfixes...
https://mbs.microsoft.com/Cms/Templates/document/General.aspx?NRMODE=Published&NRNODEGUID={35196C23-95C8-4245-8F18-19A08BFA6D99}&NRORIGINALURL=/partnersource/support/selfsupport/hottopics/nav2009sp1platformhotfixoverview.htm?printpage=false&stext=980448&NRCACHEHINT=Guest&printpage=false&stext=980448
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
http://www.epimatic.com
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
http://www.epimatic.com
SQL Profiler shows me a delete statement being run, it disappears from the card (6640), but it reappears if I wait, or I refresh or restart the page.
I am on build NAV 2009 '31510'
Frustratingly it does not happen EVERY time either. If, for example, I delete the record, ALT TAB out, ALT TAB back out again.... then when it reappears I delete it AGAIN..... then around 4 or 5 times out of 10 it will delete successfully. The rest of the time it comes back again! So the behavior is entirely random to my eyes so far.
The issue seems to be if I put ANY code of ANY kind in ANY place on the pages OnDeleteRecord() Function. Even if I put a MESSAGE('TEST') there somewhere. Then the problem happens. And interestingly the MESSAGE or ERROR or CONFIRM does not fire. I get no message.
Was there any fix or explanation for this? Is it a known issue? Should I simply NOT put ANY code in this function anywhere and instead try and put it in the "Confirm Deletion" function on the underlying table??
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
So basically the line is deleted in the page - I see a DELETE FROM command being run in the profiler - but around 8 times out of 10 the line reappears.
I honestly can not see yet how this is possible. Any ideas appreciated.
this 'feature' can -in my opinion- only have to do with user actions on the page - the system standard does always the same. I'd had a similar phenomen. If I remembered right it will delete the record correctly if your cursor resides in a non primary key field of the record when you invoke the delete.
If your cursor is standing in a primary key field, the record is deleted also but if you leave the primary key field, the record is inserted again especially if you have set a filter.
I hope that this hint can help you.
Have you investigated the text export of the page for unusual coding, filtering, timer settings or something else?
Olli
*** In the last line of OnDelete() of Table 39 I have a simple function call like this:
UpdateDuplicateOnDelete(Rec)
*** The function on Table 39 UpdateDuplicateOnDelete simply calls a codeunit
mycodeunit.UpdateDuplicateOnDelete(PurchLine)
*** The codeunit function has VERY simple code using a LOCAL variable to the function. Basically like this:
PurchaseLine2.RESET;
PurchaseLine2.CHANGECOMPANY('myothercompany');
IF PurchaseLine2.GET(PurchLine."Document Type", PurchLine."Document No.", PurchLine."Line No.")) THEN
PurchaseLine2.DELETE(FALSE);
*** It works in classic but not RTC. In classic I see in the profiler the SQL coming into the server for the DELETE(FALSE) and then the DELETE on the original table.
*** In RTC however I can see the code for the DELETE(FALSE) coming in and executing. But another "DELETE FROM" statement simply never arrives!!! It is like the .exe of Navision simply "forgets" to send the SQL to navision to delete the original record. BUT the PurchaseLine2.DELETE does work.
*** So now when I try AGAIN to delete the original record - it works !!!! Because the DELETE(FALSE) above never runs so the .exe "Remembers" to send the SQL Statement it should be sending.
The reason for my conclusion is I changed my code in the function from GET to SETRANGE with FINDFIRST. The problem STILL existed.
However I then changed it to SETRANGE with DELETEALL and the problem disappeared.
My guess is that somewhere in the EXE for the middle tier, there is a check that a delete has been run already. If it has it does not send the SQL to delete the record again.
The bug must be it ONLY does this security check using KEY and TABLE. Not COMPANY. So the middle tier Thinks my record was already deleted using an SQL statement, so it does not try to delete it again and will not re-generate new SQL statements for this.
DELETEALL however sends completely differnt SQL statements, so the check does not "fail" me here. The middle tier does not make the mistake of thinking it generated this SQL statement already.
In 2013 they must have repaired this and not use Key, Table AND company to perform this check. Therefore both SQL statements are generated correctly by the Middle Tier!!! My guess is they repaired it without even realizing.
So I will just use DELETEALL for now, which should repair my direct issue, and look forward to my upgrade to 2015 which we will be doing soon once all departments are fully switched from classic client to RTC in here
Anyone who wishes to report the bug directly to MS can do so, but I think SP1 goes out of maintenance with them soon anyway, so they likely will not care