strange behavior of cu 423
redStripe
Member Posts: 83
Hello,
during the insert of a changelogentry (Table 405) I execute code in the
CU 423 ChangeLogMng. in the InsertLogEntry trigger, which check the value
of the field "NewValue". This check should execute during each insert -
but the problem is that is allways shifted. i mean after every start of Navision
and the run through this check-function nothing happen. but in the second try
the function checks the value from the last run.
Can someone explain me that behavior?
here is the code:
thanks.
redStripe.
during the insert of a changelogentry (Table 405) I execute code in the
CU 423 ChangeLogMng. in the InsertLogEntry trigger, which check the value
of the field "NewValue". This check should execute during each insert -
but the problem is that is allways shifted. i mean after every start of Navision
and the run through this check-function nothing happen. but in the second try
the function checks the value from the last run.
Can someone explain me that behavior?
here is the code:
InsertLogEntry(VAR FldRef : FieldRef;VAR xFldRef : FieldRef;VAR RecRef : RecordRef;TypeOfChange : 'Insertion,Modification,Deletion')
ChangeLogEntry.INIT;
ChangeLogEntry."Date and Time" := ROUNDDATETIME(CURRENTDATETIME,1000);
ChangeLogEntry.Time := DT2TIME(ChangeLogEntry."Date and Time");
ChangeLogEntry."User ID" := USERID;
ChangeLogEntry."Table No." := RecRef.NUMBER;
ChangeLogEntry."Field No." := FldRef.NUMBER;
ChangeLogEntry."Type of Change" := TypeOfChange;
IF (RecRef.NUMBER = DATABASE::User) AND (FldRef.NUMBER = 2) THEN BEGIN // Password
ChangeLogEntry."Old Value" := '*';
ChangeLogEntry."New Value" := '*';
END ELSE BEGIN
IF TypeOfChange <> TypeOfChange::Insertion THEN
ChangeLogEntry."Old Value" := FormatValue(xFldRef,RecRef.NUMBER);
IF TypeOfChange <> TypeOfChange::Deletion THEN
ChangeLogEntry."New Value" := FormatValue(FldRef,RecRef.NUMBER);
END;
//bsw1000+
CLEAR(Check_value_rec);
Check_value_rec.SETRANGE(Check_value_rec."Table No.",ChangeLogEntry."Table No.");
Check_value_rec.SETRANGE(Check_value_rec."Field No.",ChangeLogEntry."Field No.");
IF Check_value_rec.FIND('-') THEN BEGIN
ChangeLogEntry.Prüfwert := Check_value_rec.ValidString;
MESSAGE('Prüfwert %1',ChangeLogEntry.Prüfwert);
IF ChangeLogEntry.Prüfwert <> ChangeLogEntry."New Value" THEN
ERROR(Text000,Check_value_rec.ValidString);
END;
//bsw1000-
thanks.
redStripe.
0
Answers
-
It is know issue with all versions of Navision that Error called from global triggers in CU1 (ChangeLog management) has this behavior. Workaround:
Use message for showing the error and after that call empty error...MESSAGE(Text000,Check_value_rec.ValidString); ERROR('');0 -
THANK YOU VERY MUCH!
..it works :-)
0 -
-
-
Could you explain this bug (and the solution) a little simpler. Maybe it's because of friday but I don't get it. :?0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

