web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Import Number Sequences using Data Import Export Framework

(0) ShareShare
ReportReport
Posted on by 756

Dear All,

Greetings , How I can import number sequence with all details using DIXF ? , i saw that article 

https://community.dynamics.com/ax/f/33/t/160935

but it is missing for details about the mentioned code , anyone have more knowledge ?, thanks.

Regards,

Hisham.

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    305,624 Super User 2026 Season 1 on at

    Hi Hisham,

    There is an existing entity in Data Import Export Framework for number sequences. Have you tried this entity? If so, are you facing some issues? Probably the code mentioned by me in the mentioned link is not required.

  • Hisham Alsayed Profile Picture
    756 on at

    Hi Andre,

             Thanks on your fast update , Yes I Tried it but it is very hard to interact after i did many tries i oversee the format filed not imported ! , also How i can interact with format control to reflect on fields in table control in same form after import , thanks.

    Regards,

    Hisham.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    305,624 Super User 2026 Season 1 on at

    Hi Hisham,

    You can try to change the method insertUpdate on the DMFNumberSequenceTableEntityClass with the changes below:

    public Common insertUpdate(Common _target, boolean _callInsertLogic = false, boolean _callValidateLogic = false)
    {
        Common                      ret;
    
        target.NumberSequenceScope = numberSeqScope.getId(true);
        
        //Annotated format - Start
        if (target.Format != '')
        {
            target.AnnotatedFormat = NumberSeq::createAnnotatedFormatFromFormat(target.Format);
        }
        //Annotated format - End
        
        ret = super(_target, _callInsertLogic, _callValidateLogic);
    
        if (_target)
        {
            target.updateHistory(NumberSeqHistoryAction::Modified);
        }
    
        return ret;
    }


    You have to add the coding starting and ending between the comments "Annotated format". Note that I haven't tested this myself. You should test it in a separate environment first.

    You can also create a job to loop the number sequence table afterwards and use similar coding.

  • Florian Hopfner Profile Picture
    2,466 on at

    Regarding the annotated format: We also had some trouble with this field first because it contains line breaks, so importing from a .csv file does not work. But when we switched to XML file format, it worked perfectly.

  • Hisham Alsayed Profile Picture
    756 on at

    Hi Andre,

           Thank you very much on your code , I tried it and it is working perfect!., but there is a small issue if you can help me I can import if scopetype = Shared otherwise give me error , i need to import with Scopetype = company it is important for me, thanks again

    Regards,

    Hisham 

  • Verified answer
    André Arnaud de Calavon Profile Picture
    305,624 Super User 2026 Season 1 on at

    Hi Hisham,

    What is the current error related to the scope type?

  • Hisham Alsayed Profile Picture
    756 on at

    Dear Andre,

                 Thanks and good day!, I received this error when i import template with DIXF and scope type "Company"

    4466.error1.jpg

    and when i browse History Log , i found this 


    Results. Record ('TT-03-0') . NumberSeqScope object not initialized.

    Stack trace

    (C)\Classes\DMFNumberSequenceTableEntityClass\insertUpdate - line 20
    (C)\Classes\DictClass\callObject
    (C)\Classes\DMFEntityWriter\write - line 680
    (S)\Classes\DMFEntityWriter\runOnServerWriter - line 47
    (C)\Classes\DMFEntityWriter\run - line 110
    (C)\Classes\DMFEntityWriter\main - line 24
    (C)\Classes\xMenuFunction\run
    (C)\Classes\MenuFunction\run - line 85
    (C)\Forms\DMFWriteData\Designs\DesignList\DMFEntityWriterBatch\Methods\Clicked - line 23

    Data written to target 'Number sequence code' ('0' records created, '0' records updated)

    Regards,

    Hisham

  • Suggested answer
    Hisham Alsayed Profile Picture
    756 on at

    Hi Andre,

          after dubbing i found out you must take DataareaId column in your generated file template which is using in import using DIXF , many thanks on your support whenever needed :)

    Regards,

    Hisham.

  • Community Member Profile Picture
    on at

    Hi,

    Have the same error code you had, how did you debug?

    cause I added Dataarea but with no success

    Thanks.

  • real_ashwin Profile Picture
    1,229 on at

    I have a blog post on how to import number sequences via DIEF maybe it will help you (no code required)

    https://ashdynamicsax.wordpress.com/2017/05/17/post12-dief-importing-number-sequences/

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 21

#2
dserp Profile Picture

dserp 4

#2
dekion Profile Picture

dekion 4

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans