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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Company Class

(0) ShareShare
ReportReport
Posted on by 1,587

hello

i am working on number sequence framework.

in AOT i am able to see all classes under class node but COMPANY class is missing.

Please help. 

 

*This post is locked for comments

I have the same question (0)
  • Neeraj.Sharma Profile Picture
    1,587 on at

    Please Reply

  • Neeraj.Sharma Profile Picture
    1,587 on at

    Hello Friends

    i am working on number sequence framework in AX 2009.

    http://msdn.microsoft.com/en-us/library/aa608474.aspx

    in which use of company class is required . please provide help on this or please suggest me some other way to achieve this.

  • Lion Profile Picture
    460 on at

    Hy neeraj

    wich version do you use 2009,4 or 3 ??

    thanks

    Abdelilah

  • Kiran Vaswani Profile Picture
    465 on at

    Hello Neeraj,

           The company class is there in class node in both ax 4.0 and ax 2009.

    Thanks.

  • Lion Profile Picture
    460 on at

    Hy Neeraj

    try to use this Line:

    appl.company().selectParameters();

    Regards

    Abdelilah

  • Denis Patrakov Profile Picture
    on at
    [quote user="Neeraj.Sharma"]i am working on number sequence framework in AX 2009 in which use of company class is required[/quote]First of all, this is not quite correct - the Company class is not required in case of creation of a new number sequence. Second, try to explain the scope of your task. There are two main aspects that define the scope:
    • are you creating a whole new AX module from the scratch or just need to add a single number sequence for a table that fits perfectly into one of the existing modules?
    • do you need your number sequence to be continuous or not?
    Note that if there are no explicit legal or other requirements than you should not party with continuous number sequences - at least until you feel yourself quite confident implementing them. All those NumberSeqFormHandler-related rituals are mostly related to (and required by) continuous number sequences. In case of a noncontinuous number sequence you can just set allowEdit/allowEditOnCreate for a corresponding table field to No, also set it's Mandatory property to Yes (it's a key field, isn't it?) and add a few lines of code to the table's initValue() method:
    public void initValue()
        NumberSeq   numberSeq = NumberSeq::newGetNum( YourParmTable::numRefMyEDT() );
        super();
        this.RecordId = numberSeq.num();
        numberSeq.used();  // mark the allocated number as used
    }
    Here YourParmTable::numRefMyEDT() is something like this (just like in the MSDN article):
    server static NumberSequenceReference numRefMyEDT()
    {
        return NumberSeqReference::findReference(typeId2ExtendedTypeId(typeid(MyEDT)));
    }
    It's just a utility method that allows you not to think about what EDT you're using for your number sequence (and hopefully for the RecordId field).
    Yet a user, or an administrator, or someone has to be able to setup your number sequence somehow, besides there's a handy number sequence setup wizard that you should support when possible. That's why you need to choose a module that your table fits best, find a correspondig class derived from the NumberSeqReference class and modify it's loadModule() method as the MSDN article states.
    So in a simpliest case you need to:
    • create an EDT (MyEDT) extending Num (or one of EDTs that extend Num in turn);
    • create a table that uses MyEDT for it's key field that is mandatory and cannot be edited by a user;
    • choose which existing module your new table fits best;
    • modify the corresponding module's parm table (create numRefMyEDT() method) and the NumberSeqReference-descendant class (modify it's loadModeul() method);
    • overload initValue() method on your table to init it's key field using the newly created number sequence.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Sukrut Parab Profile Picture

Sukrut Parab 2 Moderator

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans