Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Is it Safe to update IV40100 SET NXADJDOC

(0) ShareShare
ReportReport
Posted on by
Declare @NxtIVADJ char(17) 
Declare @NewIVADJ char(17) 
Declare @CCDocDate date
Declare @CCBatchNum char(15)
Declare @NextIVADJLEN int

select @NxtIVADJ = NXADJDOC from IV40100 with (nolock)
set @CCDocDate = CONVERT(DATE, (GETDATE()))
set @CCBatchNum = 'CYCLE COUNT'
set @NextIVADJLEN = LEN(rtrim(@NxtIVADJ))
set @NewIVADJ = (LEFT(rtrim(@NxtIVADJ), @NextIVADJLEN-5) +  convert(char(5), Convert(int ,Right(rtrim(@NxtIVADJ),5))+1))
Select @NxtIVADJ as NxtIVADJ, @CCDocDate as CCDocDate, @CCBatchNum as CCBatchNum, @NextIVADJLEN as NextLength, @NewIVADJ

BEGIN TRY
	UPDATE IV40100 Set NXADJDOC = @NewIVADJ;
END TRY
BEGIN CATCH
    --some log posts will go here
END CATCH; 

Is it safe to write directly to this Table-Field? Is there a built in function or procedure that will update(increment) this for me?

*This post is locked for comments

  • Suggested answer
    sandipdjadhav Profile Picture
    sandipdjadhav 18,267 on at
    RE: Is it Safe to update IV40100 SET NXADJDOC

    Hi,

    Check this weblink https://msdn.microsoft.com/en-us/dynamics/gp/bb687714.aspx may be help you to integrate thirdparty app with Dynamics GP. 

    Thanks much

    Sandip Jadhav

  • RE: Is it Safe to update IV40100 SET NXADJDOC

    Sandip,

       This looks very interesting. Where would one begin using .NET to integrate with Dynamics GP. I have a few small MVC EF apps that are very powerful and easy to scale and modify, but I have never attempted to act directly on the GP model, out of fear and ignorance.  Any advice?  

  • RE: Is it Safe to update IV40100 SET NXADJDOC

    Vaidy,

    Thank you. This is exactly what I was looking for, using SQL. Is there a reference anywhere to all the GP standard stored procedures and functions?

  • Verified answer
    Vaidy Mohan Profile Picture
    Vaidy Mohan 351 on at
    RE: Is it Safe to update IV40100 SET NXADJDOC

    How about using the stored procedure "taGetIvNumber" instead? It's the standard GP stored procedure (also eConnect) and does exactly what you require.

    Typical usage is as follows:

    BEGIN

    DECLARE @Error INT, @Number VARCHAR(21)

    SET @Number = ''

    SET @Error = 0

    EXEC taGetIvNumber

    1, -- Document Type (1 denotes Adjustment)

    1, -- Increment/Decrement (1 denotes increment)

    @Number OUTPUT, -- Next IV Document Number

    @Error OUTPUT -- Error State Number

    SELECT @Number, @Error

    END

    Hope that helps.

  • Verified answer
    sandipdjadhav Profile Picture
    sandipdjadhav 18,267 on at
    RE: Is it Safe to update IV40100 SET NXADJDOC

    Hi, 

    It get very difficult to manage when there are multiple users accessing same code or application.  Whereas if you are using eConnect in your project then can use Next document Number method that will handled all increment for you.

    Below is code I wrapped in Custom Web Services using eConnect.

    http://sandipdjadhav.blogspot.com/2012/04/next-document-number-web-service-using.html

    Let me know how it goes.

    Thanks much

    Sandip Jadhav

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,403 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans