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)

how to change the vendor number sequence in editable while creating the vendor.

(0) ShareShare
ReportReport
Posted on by 1,737

i want to edit the number sequence based on the vendor type.

if vendor is person i want the number sequence in edit mode and i am edit this and save it.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    I would suggest you to have a look at Fix asset, where number sequence is Fix Asset Group wise.

    All fix assets can be found at fowling path

    Fixed assets/Common/Fixed assets/Fixed assets

    As you go for creation of a new fix asset. It’s must to provide fix asset group.

    Based on selection of group, the corresponding number sequence is generated.

    If you navigate to following path, you would see how number is being maintained per AssetGroup

    AOT >> Forms >> AssetGroup

    If you want to see how next number is being achieved as you select the asset group please have a look on code at AOT >> FORMS >> AssetTable

    If you are unable to understand code or anything, come back to us with your specific question.

  • srinivas pamidi Profile Picture
    1,737 on at

    Hi sohaib,

    I know this, i am already implemented Item Id Based on the Item Group.

    In this Case the Person/organization is a Enum.

    How to set the number sequence code to this enum.

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Create  new setup, which will be based on a new Table.

    your new table will have Enum (Person/Org) as a field. and you will setup number sequence based on this setup.

  • srinivas pamidi Profile Picture
    1,737 on at

    Can u explain me in detail.

    I am Created new table with field enum and new field number sequence and setup two number sequences for two records..

    where i assign this?

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    well, I can explain you in detail and I can give you step by step procedure.

    BUT since you already know how asset number sequence work, as per your statement in previous reply.

    so kindly share your understanding how Asset number sequence is working technically??

    and if you cannot answer first have a look at what I said in my 1st reply.

    get back on thread, if you get any trouble while reading asset number sequence.

  • srinivas pamidi Profile Picture
    1,737 on at

    Yes Sohaib,

    i understand

    Write the code like

    num = NumberSeq::newGetNumFromCode(InventItemGroup::find(ItemGroupId.valueStr()).S3_ItemNemSeq).num();

    and select number sequence in item group form.

    same it is happen in fixed asset also.

  • srinivas pamidi Profile Picture
    1,737 on at

    Hi Sohaib,

    Can you just explain me..

    if vendor type is person i want to enter manual number sequence.

    it is possible.

  • Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    yes I can explain you. But before further  explanation, can you tell us which part of fix asset code you reviewed and kindly paste line of code which you observed in fix assets number generation.

    The above code shown by you is about getting next number sequence and it is not showing anything related to dynamic sequence

  • srinivas pamidi Profile Picture
    1,737 on at

    Hi Sohaib,

    Here is the step By Step Procedure of the Asset Id Number sequence based on the Asset group

    1. I am Already Debug the Code , First They are write the Code in the update design of the asset table form.

    NumberSequenceTable numberSequence;

       AssetGroup assetGroup;

       ;

       // Enable/disable fields

       assetNum1.allowEdit(assetTable.allowEditOfAssetNum());

       assetGroup = assetTable.assetGroup();

       if (assetGroup)

       {

           numberSequence = NumberSequenceTable::find(assetTable.assetGroup().AutoNumberSequenceTable);

       }

       if (!numberSequence)

       {

           numberSequence = Assetparameters::numRefAssetId().numberSequenceTable();

       }

       if (assetGroup

           && numberSequence

           && numberSequence.Continuous

           && !numberSequence.AllowChangeDown

           && !numberSequence.AllowChangeUp)

       {

           identification_AssetId.allowEdit(false);

       }

       else

       {

           identification_AssetId.allowEdit(true);

       }

    when we are open the asset table form first the debugger is enable in this method update design and in this method if asset group is not there it is take the EDT number sequence

    numberSequence = Assetparameters::numRefAssetId().numberSequenceTable();

    then next time we are give the Asset Group in the Front end Form It is take the Asset Group Number sequence.

    if (assetGroup)

       {

           numberSequence = NumberSequenceTable::find(assetTable.assetGroup().AutoNumberSequenceTable);

       }

    In this Code they are write The Code in the Asset table assetGroup() Method, It is Take the Asset Group based on the Asset Id Asset Group and in the Asset Group Table we are Given the Auto Number Sequence Table Field and Give the Number Sequence.

    Some of the Methods in the Asset Table to edit the Auto Number Sequence and

    public boolean allowEditOfAssetNum()

    {

       NoYes   allowEdit;

       ;

       allowEdit = (AssetParameters::find().AutoNumber == NoYes::No);

       if (allowEdit)

       {

           allowEdit = (this.assetGroup().AutoNumber == NoYes::No);

       }

       return allowEdit;

    }

    One Method Called initialize the Number Sequence

    public server NumberSeq initAssetNumberSeq(AssetGroupId _assetGroupId = '')

    {

       AssetParameters assetParameters = AssetParameters::find();

       AssetGroup      assetGroup = AssetGroup::find(_assetGroupId ? _assetGroupId : this.AssetGroup);

       NumberSeq       assetNumberSeq;

       ;

       if (assetGroup.AutoNumber && assetGroup.AutoNumberSequenceTable)

       {

           assetNumberSeq = NumberSeq::newGetNumFromId(assetGroup.AutoNumberSequenceTable, true);

       }

       if (!assetNumberSeq && assetParameters.AutoNumber)

       {

           assetNumberSeq = NumberSeq::newGetNum(AssetParameters::numRefAssetId(),true);

       }

       return assetNumberSeq;

    }

    In Validate Write method of the asset Table, They Write the Code Like this

    assetGroup = this.assetGroup();

       if (ret

           && assetGroup

           && assetGroup.AutoNumber

           && assetGroup.AutoNumberSequenceTable)

       {

           ret = NumberSeq::numCheckFormat(this.AssetId, NumberSequenceTable::find(assetGroup.AutoNumberSequenceTable));

       }

    In Form Asset Table ->Data Sources -> Fields ->Asset Group->Modified

    void modified()

    {

       ;

       super();

       if (assetIdNumberSeq)

           assetIdNumberSeq.abort();

       assetIdNumberSeq = assetTable.initAssetNumberSeq();

       if (assetIdNumberSeq)

       {

           assetTable.AssetId = assetIdNumberSeq.num();

           assetIdAllocated   = assetTable.AssetId;

       }

       assetTable.dataSource().refresh();

       element.updateDesign();

    }

    For Every Asset Group they create the Separate Number Sequence and They Assign in the Asset Group Form.

    Every time Change the Asset Group It is Take the New Number sequence According to the Asset Group 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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans