Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

System Mixing Numbers...

(0) ShareShare
ReportReport
Posted on by

Issue:

In the company I work we use SalesPad and GP (both systems works with integration). What happens sometimes is some kind of conflict in the situation below:

In SalesPad the user tries to make a standard order (SalesPad import from GP the next order number). It`s works fine most of the time, but sometimes for some weird reason SalesPad does not use the next order number, instead do this use the invoice number (this is the issue).

All the settings are correct in SalesPad.
In GP in:
Microsoft Dyanamics GP > Tools > Setup > Sales > Sales Order Processign Setup. The box/field "Order ID Next Number" was empty, I put the correct next order number and everything was working ok, after few hours the issue happens again, I checked GP settings and realized that (GP does not keeps the next order number). After the issue happened and when I tried to pull the next order number GP does not show it inside the box anymore.

For now the systems are working ok and sometimes mix the invoice number with the order number and sometimes no...

Questions:
1 -  If more than a user is working in the same order number (without know if someone is working in this specific order ) may be it`s causing the issue?
2 - Why after I insert the correct order number in GP it`s just disappear ?

Thanks,
Eddie


*This post is locked for comments

  • Suggested answer
    Mahmoud Saadi Profile Picture
    32,738 on at
    RE: System Mixing Numbers...

    Eddie,

    Have you checked the predefined procedure for next document number in Sales Order Processing module , which is sopGetIDNumber ?

    Here is the script of it

    USE [TWO]
    GO
    
    /****** Object:  StoredProcedure [dbo].[sopGetIDNumber]    Script Date: 25/6/15 2:37:12 AM ******/
    SET ANSI_NULLS ON
    GO
    
    SET QUOTED_IDENTIFIER OFF
    GO
    
    CREATE PROCEDURE [dbo].[sopGetIDNumber]
        @I_tSOPTYPE TINYINT = NULL ,
        @I_cDocumentID CHAR(15) = NULL ,
        @I_tInc_Dec TINYINT = NULL ,
        @O_vSOPNumber VARCHAR(21) = NULL OUTPUT ,
        @O_iErrorState INT = NULL OUTPUT
    AS 
        DECLARE @tTransaction TINYINT ,
            @iError INT ,
            @iStatus INT ,
            @vSOPNumber VARCHAR(21)
        SELECT  @O_vSOPNumber = '' ,
                @O_iErrorState = 0 ,
                @iStatus = 0
        IF @I_tSOPTYPE IS NULL
            OR @I_tInc_Dec IS NULL
            OR @I_cDocumentID IS NULL 
            BEGIN
                SELECT  @O_iErrorState = 21033
                RETURN
            END
        IF @@trancount = 0 
            BEGIN
                SELECT  @tTransaction = 1
                BEGIN TRANSACTION
            END
        SELECT  @O_vSOPNumber = SOPNUMBE
        FROM    SOP40200 WITH ( TABLOCKX HOLDLOCK )
        WHERE   SOPTYPE = @I_tSOPTYPE
                AND DOCID = @I_cDocumentID
        IF ( @@rowcount <> 1 ) 
            BEGIN
                SELECT  @O_iErrorState = 21034
            END
        IF @O_iErrorState = 0 
            BEGIN
                SELECT  @vSOPNumber = @O_vSOPNumber
                EXEC @iStatus = ivNumber_Inc_Dec @I_tInc_Dec, @vSOPNumber OUTPUT,
                    @O_iErrorState OUTPUT
                SELECT  @iError = @@error
                IF @iStatus = 0
                    AND @iError <> 0 
                    SELECT  @iStatus = @iError
                UPDATE  SOP40200
                SET     SOPNUMBE = @vSOPNumber
                WHERE   SOPTYPE = @I_tSOPTYPE
                        AND DOCID = @I_cDocumentID
            END
        IF @O_iErrorState <> 0
            OR @iStatus <> 0 
            BEGIN
                SELECT  @O_vSOPNumber = ''
                IF @tTransaction = 1 
                    ROLLBACK TRANSACTION
            END
        ELSE 
            BEGIN
                IF @tTransaction = 1 
                    COMMIT TRANSACTION
            END
        RETURN(@iStatus)    
    GO
    
    
    


    Using this procedure will guarantee getting the next number per document properly, make sure to pass the required parameters which are practically the SOP TYPE, Document ID ..etc

    Your feedback is highly appreciated,

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Almas Mahfooz Profile Picture

Almas Mahfooz 3 User Group Leader

Featured topics

Product updates

Dynamics 365 release plans