Number Sequence D365FO


Number Sequence D365FO 




Number sequences are used to generate readable, unique identifiers for master data records and transaction records that require identifiers.
In this demo, I am going to create a new number sequence for customer group form.

Create a new class with name NumberSeqModuleCustomer_CustGroup that extends the NumberSeqModuleCustomer class and then create the method loadNumberSequence.

Reference Screenshot:


Now create extension class of CustParameters_Extension and add your custom method to find number sequence..

Reference Screenshot:



Now create Run able class to initialize the  number sequence...


Reference Screenshot:


Perform build & Sync and load the number sequence. In my demo i have place Action menu item of executable class on following navigation.


Reference Screenshot:


Now Navigate to organization administration > Number sequence and generate number sequence.

 Reference Screenshot:



Next Step to Navigate to Account receivable parameter setup to veriy our newly create number sequence loaded successfully or not...  You have to verify on your desire number sequence module.




Next step to override CustGroup form data source Initial value event.


 Reference Screenshot:



Perform build & Sync and verify on your cust group.. for me its working fine please have look on below screenshot.


Please feel free to contact me if you are facing any issue during implementation of above blog.

Support Faryal's Cusine


Create Vendor using X++ D365FO & AX-2012


Create Vendor using X++ D365FO & AX-2012



Following Code will help you to create Vendor using X++

For Default Dimension please check Link

public class VendorHelper
{

 

   

  
        private void new()
        {
        }

        public static VendorHelper construct()
        {
            return new VendorHelper();
        }

        public void createVendor()
        {
            VendTable                    vendTable;
            NumberSeq                    numberSeq;
            Name                         name ='Systems Limited Karachi, Pakistan';

            DirParty                        dirParty;
            DirPartyPostalAddressView       dirPartyPostalAddressView;
            DirPartyContactInfoView         dirPartyContactInfo;
            ;
            container      conAttribute=["BusinessUnit","CostCenter","Department"];
            container      conAttributeValue=["001","007","022"];
            /* Marks the beginning of a transaction.
            Necessary to utilize the method numRefCustAccount() */
            ttsBegin;
            vendTable.initValue();

            try
{
                //vendTable
            //numberSeq               = NumberSeq::newGetNum(VendParameters::numRefVendAccount())
                // vendTable.AccountNum    = numberSeq.num();
                vendTable.AccountNum    = "Vend-00099";
                vendTable.VendGroup     ='30';
                vendTable.Currency      ='USD';
                vendTable.PaymTermId    ='Net10';
                vendTable.PaymMode      ='CHECK';
                vendTable.DefaultDimension=DefaultDimesnionHelper::createDefaultDimension(conAttribute,conAttributeValue);
                vendTable.insert();

                //DirParty

                /* Creates a new instance of the DirParty class from an address book entity
                that is represented by the custTable parameter. */
                dirParty = DirParty::constructFromCommon(vendTable);

                dirPartyPostalAddressView.LocationName      ='Systems limited Karachi, Pakistan ';
                dirPartyPostalAddressView.City              ='Karachi';
                dirPartyPostalAddressView.Street            ='Shah-re-faisal alcope-house';
                dirPartyPostalAddressView.StreetNumber      ='18';
                dirPartyPostalAddressView.CountryRegionId   ='PAK';
                dirPartyPostalAddressView.State             ='Sindh';
                dirPartyPostalAddressView.IsPrimary             = NoYes::Yes;
                // Fill address
                dirParty.createOrUpdatePostalAddress(dirPartyPostalAddressView);


                dirPartyContactInfo.LocationName    ='Email Address';
                dirPartyContactInfo.Locator         ='ShaikhSohailHussain@gmail.com';
                dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Email;
                dirPartyContactInfo.IsPrimary       = NoYes::Yes;

                // Fill Contacts
                dirParty.createOrUpdateContactInfo(dirPartyContactInfo);


                dirPartyContactInfo.LocationName    ='Mobile Number';
                dirPartyContactInfo.Locator         ='923422722538';
                dirPartyContactInfo.Type            = LogisticsElectronicAddressMethodType::Phone;
                dirPartyContactInfo.IsPrimary       = NoYes::Yes;

                // Fill Contacts
                dirParty.createOrUpdateContactInfo(dirPartyContactInfo);

                // Marks the end of transaction.
                ttsCommit;
            }
            catch(Exception::Error)
            {
                ttsAbort;
                throw Exception::Error;
            }
        }

}

Support Faryal's Cusine


Virtual Fields Vs Computed Fields

  Virtual Field: A virtual field in D365FO is a field that doesn't have a direct representation in the database. It's a field that y...