Is it possible to remove sales invoice lines when using batch update?
If I update the following sales invoice:
| Lines.1.Item |
Lines.1.SalesUnitPrice |
Key |
| Item1 |
10 |
jksdanfknweklfmdsf |
| Item2 |
15 |
90904jweionsdgsdfg |
to
| Lines.1.Item |
Lines.1.SalesUnitPrice |
Key |
| Item1 |
10 |
jksdanfknweklfmdsf |
|
|
90904jweionsdgsdfg |
the sales invoice now has a blank line on line 2
Removing the second line from the update doesn’t change the outcome either.
Hi @Flakily8674,
Removing lines wasn’t possible then it was possible for a while and now it isn’t again.
I don’t know whether there’s a reason behind this behavior but I think there should be a way to delete completely blank lines, preferably during Batch update operation
Thank you for the clarification.
I think the Sales - Lines view should add the functionality. Currently, there is only “Batch View” feature when selecting Batch Operation under the Sales - Lines view.
[This issue is marked as Solved, however I do not think an actual solution was presented.]
I tried two approaches. Both seem to work, however I would like comments on their safety.
The first is done programmatically, the second using a spreadseet.
- The program does the following (I’d be happy to provide the [Python] source):
- select the affected transactions for Batch Update and copy to Clipboard
- paste the lines into a tab separated file (.tsv file)
- read this file into the program, creating a list of dictionaries, one for each line, with as keys the column names and as values whatever is in the transaction for that column
- remove all elements from each of the dictionaries that have keys like “Lines.2.X” (where 2 is the empty line number)
- write the resulting list of dictionaries back into a new .tsv file
- use that file as source for the batch update.
This seems to work fine, however what I am doing is not documented as far as I know. Am I safe or am I violating some integrity constraints of the data model that might come back and bite me at some later moment?
- My second solution is to copy the Batch Update data into a spreadsheet, removing all Lines.2.X columns, and also deleting the content of the Key fields, then paste the result into a Batch Create (not: Update) window. But then, you must not forget to delete the original transactions. Again, not sure if this is safe.
What do others think?