Posts

Showing posts from February, 2019

FormLetter class COC method in D365 X++

[ExtensionOf(classStr(PurchFormLetter))] final class PurchFormLetter_Extension {     static container checkParmTable(Num      parmId,                                            boolean  vendAccountInQuery,                                            boolean  invoiceAccountInQuery)     {         PurchParmTable                  purchParmTable;         P...

Number sequence class extension for load module in D365 X++

[ExtensionOf(classStr(NumberSeqModuleCRM))] final class NumberSeqModuleCRM_Extension {  protected void loadModule()  {   NumberSeqDatatype datatype = NumberSeqDatatype::construct();   next loadModule();//COC method call   datatype.parmDatatypeId(extendedTypeNum(DH_NewNumSeq));   datatype.parmConfigurationKeyId(configurationKeyNum(SmmCRM));   datatype.parmReferenceHelp(literalStr("@DH:DH_NewNumSeq")); // Unique key for Leads   datatype.parmWizardIsContinuous(false);   datatype.parmWizardfetchAheadQty(10);   datatype.parmWizardIsManual(NoYes::No);   datatype.parmWizardIsChangeDownAllowed(NoYes::No);   datatype.parmWizardIsChangeUpAllowed(NoYes::No);   datatype.parmSortField(13);   datatype.parmWizardHighest(999999);   datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);   this.create(datatype);  } }

On clicked event of form button in D365 X++

Form : SalesQuotationListPage Button : DH_AmendmentButton DataSource : SalesQuotationTable [FormControlEventHandler(formControlStr(SalesQuotationListPage, DH_AmendmentButton), FormControlEventType::Clicked)]     public static void DH_AmendmentButton_OnClicked(FormControl sender, FormControlEventArgs e)     {         FormRun                  fromRunLoc;         FormDataSource      formDataSourceLoc;         SalesQuotationTable salesQuoteTable;         DH_SalesQuote        DHQuote;         fromRunLoc             = sender.formRun();         formDataSourceLoc   = sender.formRun().dataSource("SalesQuotationTable");         salesQuoteTable       = formDataSourceLoc.cursor(); ...

Enable/Disable form control on activation of form D365 X++

Form : SalesQuotationListPage DataSource : DH_SalesQuote Event : Activated [FormDataSourceEventHandler(formDataSourceStr(SalesQuotationListPage, DH_SalesQuote), FormDataSourceEventType::Activated)]     public static void DH_SalesQuote_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)     {         FormRun                  fromRunLoc;         FormDataSource      formDataSourceLoc;         DH_SalesQuote       SalesQuote;         fromRunLoc            = sender.formRun();         formDataSourceLoc   = sender.formRun().dataSource("DH_SalesQuote");         SalesQuote               = formDataSourceLoc.cursor();         if (SalesQuote.DH_DocumentWorkflo...

On inserted event of table D365 x++

[DataEventHandler(tableStr(SalesQuotationTable), DataEventType::Inserted)]     public static void SalesQuotationTable_onInserted(Common sender, DataEventArgs e)     {         SalesQuotationTable         salesQuotationTable = sender;         DH_SalesQuote              SalesQuote;         select firstonly SalesQuote             where SalesQuote.QuotationId == salesQuotationTable.QuotationId;         if (!SalesQuote.RecId)         {             SalesQuote.QuotationId  = salesQuotationTable.QuotationId;             SalesQuote.RefRecId     = salesQuotationTable.RecId;             SalesQuote.DocumentWorkflowState    = DH_DocumentWorkflowState::NotSubmitte...