RecreateSalesLines -- Why?

njhansen
Member Posts: 37
Can anyone provide a comprehensive list of the reasons that NAV deletes the sales lines and recreates them after certain user actions? For instance it recreates them after changing bill-to customer no.
I know some of the effects, but am not sure I know them all:
1) Update dimension data and other data copied from header to lines
2) Prevent changes if some lines have already posted
The problem:
We've received some add-in code from a third party that works fine until we do something that causes SalesHeader.RecreateSalesLines to run. I've worked through repairing most of the negative side effects, but am hung up at a place at which the most straightforward resolution require a commit (codeunit call that modifies its own copy of the SalesLine record). I don't want to commit in the middle of recreating sales lines, since later code can still error.
So, I was considering trying to go another route to get the same effects that RecreateSalesLine is getting, but without calling it. But to do that, I need to know what all the effects should be.
In addition, I'm just curious as to why RecreateSalesLines exists. It seems that if the goal is purely to refresh data from the header that discarding then recreating all the lines is overly complicated. If some other goal is in mind, it seems strange that most of the values being re-created are not validated.
I know some of the effects, but am not sure I know them all:
1) Update dimension data and other data copied from header to lines
2) Prevent changes if some lines have already posted
The problem:
We've received some add-in code from a third party that works fine until we do something that causes SalesHeader.RecreateSalesLines to run. I've worked through repairing most of the negative side effects, but am hung up at a place at which the most straightforward resolution require a commit (codeunit call that modifies its own copy of the SalesLine record). I don't want to commit in the middle of recreating sales lines, since later code can still error.
So, I was considering trying to go another route to get the same effects that RecreateSalesLine is getting, but without calling it. But to do that, I need to know what all the effects should be.
In addition, I'm just curious as to why RecreateSalesLines exists. It seems that if the goal is purely to refresh data from the header that discarding then recreating all the lines is overly complicated. If some other goal is in mind, it seems strange that most of the values being re-created are not validated.
0
Answers
-
If you change the "Bill-to Customer No.", the other customer could have a different language setting, therefore the Item Description needs to be updated. The other customer could have a different discount group, therefore the price needs to be updated. etc.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
Thanks Luc. Multi-lingual and multi-currency issues are "obvious" ones I should have thought of; our current environment doesn't require either, but we might in the future.
Lacking any other responses, I'll consider this question answered for now.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