I was trying to add an item between an existing sales order and "You cannot insert a row" error pops up. I have tried to check for any security related issue so I've logged in as "sa" and still shows up.
However, I can add an item at the top or the bottom. When I do add an item or two or even replacing an item my, packing slip will print two or more even if I don't have "Print Separate Picking Ticket Per Site" at sales document print option applied.
I have tried numerous scenario on trying to recreate this error and cannot on a different database. Is there GP setting that will prevent user from adding a row in between items? Additionally, where could I check to prevent picking ticket or packing slip to show only one report even if it's from two different site ID
*This post is locked for comments
Hi everyone,
Just wanted to say how I got ride of my problem. In my case, I simply checked the LNITMSEQ of the SOP document where the problem was pointed at (the line in problem was indeed sequential with the next line but not with the second line after). I had the user suppress the line right after where he was trying to insert a line (deleting the sequential) so he was able to insert the lines where he wanted. He also had to re-enter the line that I made him delete. Et Voilà !
Way more safer by the app than by the DBs. ;¬)
Have a nice day!
Just for other readers, be aware that merely renumbering the order lines sequence can orphan records if you don't catch all the dependant tables.
There may be 3rd party products doing wacky things too, just have a careful think.
At the end of this post is a query to run to find all the tables with line sequence column name, many are not SOP tables, check they are not referencing sop tables though.
There are more obvious ones like POP-SOP links, order line comments etc.
Although not likely to seriously screw up, it may cause some issues if not executed carefully.
SELECT c.NAME AS 'ColumnName'
,t.NAME AS 'TableName'
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.NAME LIKE '%LNITMSEQ%'
ORDER BY TableName
,ColumnName;
I have also verified the answer as you suggested.
Can someone "Verifie" Ian's suggestion please ?
It solve my problem (witch was the one mentionned in this post).
I think I can't do it since not the person who posted this question.
Thank you Ian,
Clear explaination! Got me out of trouble real quick!
Really appreciated! ;¬)
Yes. User can insert new rows between the lines if you correct the line sequence number in backend.
Hope this helps!!!
Ian, thank you for this excellent information but I have an additional question. Could I go through SQL and change the line numbers for a specific order so the user can get around the issue.
Hi Kenta - the line item sequence number works in multiples of 16384.
So the first line you (manually) enter on a sales order gets 16,384. If you then add a line after that, it gets number 32,768, and the next (third line) is 49,152...and so on.
This means that you can go back and insert a new line between lines 1 and 2 - and this gets a line item sequence number of 24,576 (Half way between 16,384 and 32,768).
So - a limitation...you can add two lines to a sales document, and then start inserting new lines between these...up to a maximum of 16,383 inserted lines.
In your case above - the two lines where you were trying to insert a new line - must have been sequential - ie 16384 followed by 16,385...or something like that.
This asks the question - how were these lines added? It is unlikely that a user managed to insert 16,383 lines manually!! - I am guessing that you are importing the lines using a custom application. If so, you need to check the code that inserts lines - and force the Line Item Sequence Number to operate in multiples of 16,384...and so mimic what GP does when you manually enter a transaction line.
Hope this helps.
Ian.
Thank you Ian. I ran the query and it made sense after looking at those numbers.
It uses 16384 as the first number and incremented 1 thereafter.
Hi Kenta,
Can you run the following query aginst the database where the problem sales document is?
SELECT LNITMSEQ FROM SOP10200 WHERE SOPNUMBE = '?????'
If this returns no rows, then run the following
SELECT LNITMSEQ FROM SOP30300 WHERE SOPNUMBE = '?????'
('?????' ... replace this with the SOP Document Number of the problem sales document).
Can you post the results here?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156