In this blog , we will create a new number sequence in D365 Finance and Operations form.
And this blog will contain below steps for the users and user will be able to understand below steps as well:
protected void loadModule(){NumberSeqDatatype datatype = NumberSeqDatatype::construct();datatype.parmDatatypeId(extendedTypeNum(AnandBook2_VehicleId));datatype.parmReferenceLabel("Anand Vehicle Id");datatype.parmReferenceHelp(literalStr("Unique key used for the cars."));datatype.parmWizardIsContinuous(false);datatype.parmWizardIsManual(NoYes::No);datatype.parmWizardFetchAheadQty(10);datatype.parmWizardIsChangeDownAllowed(NoYes::No);datatype.parmWizardIsChangeUpAllowed(NoYes::No);datatype.parmSortField(1);datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);this.create(datatype);}
[SubscribesTo(classstr(NumberSeqGlobal),delegatestr(NumberSeqGlobal,buildModulesMapDelegate))]static void buildModulesMapSubsciber(Map numberSeqModuleNamesMap){NumberSeqGlobal::addModuleToMap(classnum(VehicleIdNumSeq), numberSeqModuleNamesMap);}
public NumberSeqModule numberSeqModule(){return NumberSeqModule::Cust;}
Here Cust is for Accounts Receivables Parameters form to know all the codes we can check the designer. If I select Asset , then our Field of Code will be available in Fixed Assets Parameters form.
e. Create a new runnable class and add the code and set it as a startup object.class LoadVehicleIdNumSeq{/// <summary>/// Runs the class with the specified arguments./// </summary>/// <param name = "_args">The specified arguments.</param>public static void main(Args _args){VehicleIdNumSeq VehicleIdNumSeq = new VehicleIdNumSeq();VehicleIdNumSeq.load();}}
f. To add it as Startup Object, right click on the solution and Set as Startup Object.