Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

SOP30300 LNITMSEQ - unique id for invoice line items

Posted on by 150

I am creating an integration of GP invoices to Dynamics CRM invoices.  I have exported data from the SOP30300 table for the invoice line items and I would like to have a uniqiue id in my staging table.  Can I combine SOPNUMBE and LNITMSEQ to create a unique id.  I have read that I should never consider using DEX_ROW_ID as a unique id as it can change during a GP Upgrade.

*This post is locked for comments

  • Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: SOP30300 LNITMSEQ - unique id for invoice line items

    Since you are creating a staging table, you can create a column of data type UNIQUEIDENTIFIER to store a GUID for each line inserted in it, i.e.:

    CREATE TABLE SOP_LINE_STAGE (
      ItemNumber VARCHAR(50),
      ComponentSequence INT,
      SOPNumber VARCHAR(30),
      LineItemSequence INT,
      QuantityInvoiced NUMERIC(19,5),
      UnitPrice NUMERIC(19,5),
      ExtendedPrice NUMERIC(19,5),
      UniqueId UNIQUEIDENTIFIER DEFAULT NEWID()
    );


    You don't need to engineer some complicated key to keep track of a unique line value.

  • Verified answer
    Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: SOP30300 LNITMSEQ - unique id for invoice line items

    The primary key for SOP30300 is

    SOPTYPE

    SOPNUMBE

    LNITMSEQ

    CMPNTSEQ

    If all your documents are invoices set SOPTYPE to 3 and CMPNTSEQ to 0 if yo have no components of bills of materials. DEX_ROW_ID can be used under certain circumstances but this is not one of them.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans