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.
0
Answers
Lacking any other responses, I'll consider this question answered for now.