Client crash by RecordRef ?

einsTeIn.NET
Member Posts: 1,050
Greetings Earthlings! 
I have a very strange system behaviour after implementing a new function. Maybe someone knows about problems with RecordRef.
I created a new functionality very similar to the Change Log functionality. The only difference is that my function isn't called by CU 1 but by the Modify Trigger of some tables or by the Validate Trigger of certain fields of these tables. And of course I don't use the Change Log Tables to setup my function and to store the created entries.
If my function is called by the Modify Trigger then the client crashes always after the function IsNormalField has been called. The Debugger steps back into the function LogModification and the windows message for reporting the error pops up. Nothing else. No "internal error x in module y" or something like that.
If my function is called by the Validate Trigger of a field then it works really good.
Does anyone has a suggestion what I can do?

I have a very strange system behaviour after implementing a new function. Maybe someone knows about problems with RecordRef.
I created a new functionality very similar to the Change Log functionality. The only difference is that my function isn't called by CU 1 but by the Modify Trigger of some tables or by the Validate Trigger of certain fields of these tables. And of course I don't use the Change Log Tables to setup my function and to store the created entries.
If my function is called by the Modify Trigger then the client crashes always after the function IsNormalField has been called. The Debugger steps back into the function LogModification and the windows message for reporting the error pops up. Nothing else. No "internal error x in module y" or something like that.
If my function is called by the Validate Trigger of a field then it works really good.
Does anyone has a suggestion what I can do?
"Money is likewise the greatest chance and the greatest scourge of mankind."
0
Comments
-
Knowing the X & Y would probably be helpful"internal error x in module y"0
-
Sorry, but there is no X and no Y because there is no such an error message!"Money is likewise the greatest chance and the greatest scourge of mankind."0
-
Oh oops - I see my reading mistake now :oops:
So basically your having problems using your code in OnModify but it works fine in OnValidate.0 -
Yes, that's the only difference I can see.
But I don't think it has anything to do with this difference. I think it's the way Navision handles RecordRefs. Maybe I should post the code of both functions. Normally everybody who worked for a longer time with the Navision development environment should have heard of these functions but maybe only a few keep them in mind.
IsNormalField(TableNumber : Integer;FieldNumber : Integer) : BooleanGetField(TableNumber,FieldNumber,Field); EXIT(Field.Class = TempField.Class::Normal);
LogModification(VAR RecRef : RecordRef;VAR xRecRef : RecordRef)IF NOT IsLogActive(RecRef.NUMBER,0,1) THEN EXIT; FOR i := 1 TO RecRef.FIELDCOUNT DO BEGIN FldRef := RecRef.FIELDINDEX(i); xFldRef := xRecRef.FIELDINDEX(i); IF IsNormalField(RecRef.NUMBER,FldRef.NUMBER) THEN IF FORMAT(FldRef.VALUE) <> FORMAT(xFldRef.VALUE) THEN IF IsLogActive(RecRef.NUMBER,FldRef.NUMBER,1) THEN InsertLogEntry(FldRef,xFldRef,RecRef,1); END;
The debugger goes through the function IsNormalField and jumps back into the function LogModification and then the client crashes. I put in a message in like thisIF IsNormalField(RecRef.NUMBER,FldRef.NUMBER) THEN BEGIN MESSAGE('Back in LogModification'); IF FORMAT(FldRef.VALUE) <> FORMAT(xFldRef.VALUE) THEN
but even this message will not be executed.
I even made a client update (technical). Now 4.00 SP3 but it didn't solve the problem."Money is likewise the greatest chance and the greatest scourge of mankind."0 -
I recognized in the past, that NAV will crash without any error message if you access a text or code field with a field length (by design) less than 5 (or 10?) characters.
Solution: Extend the field length to a minimum of 10 characters.Timo Lässer
Microsoft Dynamics NAV Developer since 1997
MSDynamics.de - German Microsoft Dynamics Community - member of [clip]0 -
Good idea. But sorry, there is no field with such a small field length within my table.
I have read here in one topic that there are some problems with RecordRef if you have not closed the RecordRef correct. And in another topic that there will be a check for an incorrect close of RecordRef in NAV 5.0. Sorry, but I can't find both topics again yet. Maybe it has something to do with that problem?
[edit]
this is the first topic ... (still searching for)
and this is the 2nd topic http://www.mibuso.com/forum/viewtopic.php?t=19865
I tried to put in a RecRef.CLOSE after every call, but that didn't solve the problem anyway. Maybe I should use CLEAR instaed of CLOSE or maybe RESET as suggested in this thread http://www.mibuso.com/forum/viewtopic.php?t=17087???
[/edit]"Money is likewise the greatest chance and the greatest scourge of mankind."0 -
I tried CLEAR, CLOSE and RESET, but it did not solve the problem.
I think the problem is comparable to this problem http://www.mibuso.com/forum/viewtopic.php?t=14150. A function that works really great is called in another context and the Navision Client will crash. Very strange!"Money is likewise the greatest chance and the greatest scourge of mankind."0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions