Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How can a user generate RECID

Posted on by Microsoft Employee

Greetings:

We are trying to convert our chart of accounts from old system to new system and have gone far along. However, at this time, we are only concerned about how to generate or control the RECID field to correctly populate LedgerTrans table. I did happen to read http://msdn.microsoft.com/en-us/library/aa638594.aspx but that didn't help much. The reason for not doing through template (may be the last resort) is because we have too many companies and thus we are trying to control even the DATAAREAID with our code (something that templates doesn't allow).

Any ideas/thoughts are more than welcome. Please advise. Thanks.

Kind regards,

Manish Wadhwa. 

*This post is locked for comments

  • Carlos Herrando Profile Picture
    Carlos Herrando 165 on at
    Re: Re: Re: Re: Re: How can a user generate RECID

    Hello Kiran,

    There are serveral registers in the SystemSequences table. How do you determine what is the appropiate register to get and update the NextVal for the table you are inserting new registers?

    Regards

        Carlos

  • Kiran Vaswani Profile Picture
    Kiran Vaswani 465 on at
    Re: Re: Re: Re: Re: How can a user generate RECID
    Hello Manish,
    Very happy new year to you as well..
    You can not use other company in where clause other then dat as you just open SystemSequances table in sql server you will see there is only one dataareaId in all the records.
    You can use dat to generate your RecId and when you will see SystemSequances table then you can easily understand why we are using name as SEQNO.
    Hope this helps.

    Thanks.
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Re: Re: Re: How can a user generate RECID

    Hey Kiran,

    Thank you so much for this quick response. I am a little confused over the where clause in the query. Does the dataareaid has to be mandatorily 'dat' or would that be company specific. Also I am not quite sure on name = 'SEQNO'. Whenever convenient, can you please throw some lights on these as well just for my better understanding.

    Really appreciate your insights here Kiran. And hey, Happy New Year! Hope you make the best of this new year to bring happiness among loved ones!

    Regards,

    Manish

  • Kiran Vaswani Profile Picture
    Kiran Vaswani 465 on at
    Re: Re: Re: How can a user generate RECID
    Hello Manish, Try this code ..

    ALTER procedure [dbo].[SP_GetAXRecID](@axRecid bigint output)
    as
    begin
    update [Server].Databse.dbo.systemsequences
    set @axRecid = nextVal = nextVal + 1
    from [Server].Databse.dbo.systemsequences where
    dataareaid = 'dat' and name = 'SEQNO'
    end
    I used this code when I tried to insert the data in AX from other sql server database through SP.
    Thanks.
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Re: How can a user generate RECID

    Hey Eric,

    We already have full control on DATAAREAID as its value (always known) can be programmed based on the company that you want to put data in. Our concern is around RECID. How do we generate that. I am hoping that Dynamics AX would have some build in function that generates RECID in appropriate manner. We can just use that in our PL/SQL.

    Any thoughts anyone?

  • Eric Greathouse Profile Picture
    Eric Greathouse 45 on at
    Re: How can a user generate RECID

    I'm guessing you are using AX. One thing that may work is importing into 1 company and then doing an update through SQL to give each account the correct DATAAREAID

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans