Change log on Sales Header / Shipment Date

frede
Member Posts: 80
Hi all experts and Navision Freaks...
I have this funny question:
Why does the Change Log work when changing "Shipment Date" but saying "No" to the update of sales lines.
But it does NOT work, when the user says "Yes" to update the sales lines.
It is tested in 3.70A, 3.70B and 4.00 - with same result....
Any answers is greatly appreciated.. :?: ](*,)
I have this funny question:
Why does the Change Log work when changing "Shipment Date" but saying "No" to the update of sales lines.
But it does NOT work, when the user says "Yes" to update the sales lines.
It is tested in 3.70A, 3.70B and 4.00 - with same result....
Any answers is greatly appreciated.. :?: ](*,)
Regards,
Henrik Frederiksen, Denmark
Henrik Frederiksen, Denmark
0
Comments
-
Because the change of the "Shipment Date" has been made by hand (by entering a different value in the Shipment Date field), and the change of the Sales Line has been made by some C/AL Code.
The Change Log only handles the changes made by human beings.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Thanx Luc,
but the change of Shipment Date on Sales Header is made "by hand" in both cases..
I can understand that no logging of the lines change - but not the change of the header!!Regards,
Henrik Frederiksen, Denmark0 -
In both cases Navision should log the change of the header....! ](*,) ](*,) ](*,)Regards,
Henrik Frederiksen, Denmark0 -
Change Log Setup - may be field dosen't put there?0
-
frede wrote:In both cases Navision should log the change of the header....! ](*,) ](*,) ](*,)
After the transaction started by the OnValidate is finished, is the user placed back in the form. When the user press esc/page-up (etc.) the automatic update is started, that might store something in the ChangeLog. However, it will not find any differences, so it will not log anything.
This situation MIGHT be changed by Update 1 to 4.0. I seem to remember that the logic to find xRec has been changed, but I don't know if it solves this problem.
You can also solve the problem yourself, however you can only do it one by one. For example like this:UpdateSalesLines(ChangedFieldName : Text[100];AskQuestion : Boolean) ... SalesLine.LOCKTABLE; // >> RecRef.GETTABLE(Rec); xRecRef.OPEN(RecRef.NUMBER); xRecRef.GET(RecRef.RECORDID); ChangeLogManagement.LogModification(RecRef,xRecRef); // << MODIFY; SalesLine.RESET; ...
(Not tested, but it should work - otherwise let me know ;-))Regards
Peter0 -
pdj wrote:
UpdateSalesLines(ChangedFieldName : Text[100];AskQuestion : Boolean) ... SalesLine.LOCKTABLE; // >> RecRef.GETTABLE(Rec); xRecRef.OPEN(RecRef.NUMBER); xRecRef.GET(RecRef.RECORDID); ChangeLogManagement.LogModification(RecRef,xRecRef); // << MODIFY; SalesLine.RESET; ...
(Not tested, but it should work - otherwise let me know ;-))
RecRef - RECORDREF
ChangeLogManagement - Codeunit "Change Log Management"
Do I need to initiate ChangeLogManagement? Or 4 strings make the record in table change log entry?0 -
Hi pdj,
your code works!
Now I found the answer why Navision didn't log changes by field Routing No. or Production BOM No. in Table Item.
Excellent.
Regards
Tirta0
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