Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

"You cannot insert a row" at sales transaction window

Posted on by 120

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: "You cannot insert a row" at sales transaction window

    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!

  • Tim Wappat Profile Picture
    Tim Wappat 5,701 on at
    RE: "You cannot insert a row" at sales transaction window

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: "You cannot insert a row" at sales transaction window

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: "You cannot insert a row" at sales transaction window

    Thank you Ian,

    Clear explaination! Got me out of trouble real quick!

    Really appreciated! ;¬)

  • soma Profile Picture
    soma 24,406 on at
    RE: "You cannot insert a row" at sales transaction window

    Yes. User can insert new rows between the lines if you correct the line sequence number in backend.

    Hope this helps!!!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: "You cannot insert a row" at sales transaction window

    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.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: "You cannot insert a row" at sales transaction window

    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.

  • Kenta Harada Profile Picture
    Kenta Harada 120 on at
    Re: "You cannot insert a row" at sales transaction window

    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.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: "You cannot insert a row" at sales transaction window

    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?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans