Posts

Print sales invoice report through code

 internal final class printSOInvoiceReport {     /// <summary>     /// Class entry point. The system will call this method when a designated menu      /// is selected or when execution starts and this class is set as the startup class.     /// </summary>     /// <param name = "_args">The specified arguments.</param>     public static void main(Args _args)     {         CustInvoiceJour custInvoiceJour = CustInvoiceJour::findFromSalesId('test98');         str ext = SRSPrintDestinationSettings::findFileNameType(SRSReportFileFormat::PDF, SRSImageFileFormat::BMP);         PrintMgmtReportFormatName printMgmtReportFormatName = PrintMgmtDocType::construct(PrintMgmtDocumentType::SalesOrderInvoice).getDefaultReportFormat();                                 ...

Calculations in view (Computed column)

-------------------------------------------------------------Addition-------------------------------------------   private static str compLineAmountMethod()     {         str                 sFirstLine, sLineAmount, sReturn, sReturn1, sSetItemAttr, sCostTotal, sSumLineDisc;         sFirstLine          = SysComputedColumn::returnField(tableStr(ExportInvoicesDataCustomsView_ABC), #DataSourceName, fieldStr(SetComponents_ABC, FirstLine));         sLineAmount         = SysComputedColumn::returnField(tableStr(ExportInvoicesDataCustomsView_ABC), #DataSourceName1, fieldStr(CustInvoiceTrans, LineAmount));         sSetItemAttr        = SysComputedColumn::returnField(tableStr(ExportInvoicesDataCustomsView_ABC), identifierStr(ItemAttributeValueView_SetItem), fieldStr(ItemAttributeValueView_AB...

Adding Range From Miltiselect Of the batch job

 List                            poolList;         container                       conPool;         NoYes                           splitPurchLine;         boolean                         flag = false, equalQuantities = false;         Qty                             originalQty =0 ;         q                               = new Query(contract.getQuery());         qbds                        ...

Create custom feature to add in the feature management

Steps to write custom feature code 1. Create class to create new feature  2. Build the project after creating the class 3. In the feature management click on check for updates to see the new feature 4. Use this class to enable/disable new feature from feature management, condition is written like below Condition by using feature management   if (FeatureStateProviderV0::isFeatureEnabled(ClassNameFeature ::instance())) { //Code here } Creation of class : using Composition = System.ComponentModel.Composition; [Composition.ExportAttribute(identifierstr(Dynamics.AX.Application.IFeatureMetadataV0))] public final class ClassNameFeature implements IFeatureMetadataV0 {     private static ClassNameFeature instance;     private void new()     {     }     private static void TypeNew()     {         instance = new ClassNameFeature();     }     [Hookable(false)]     public...

Charges creation before sales invoice posting

 /// <summary> ///  /// </summary> [ExtensionOf(classStr(SalesInvoiceJournalCreate))] final class SalesInvoiceJournalCreate_Extension {     public void run()     {         SalesParmTable                  salesParmTable;         SalesParmUpdate                 salesParmUpdate;         CustParameters                  custParameters = CustParameters::find();         if (custParameters.AdvanceStampDutyManagement_Custom)         {             SalesTotals     salesTotals;             TmpTaxWorkTrans tmpTaxWorkTrans;             MarkupTrans     markupTrans;             Sales...

Charges creation before free text invoice posting

 /// <summary> /// Create chages for free text invoices. /// </summary> [ExtensionOf(classStr(CustPostInvoiceJob))] final class CustPostInvoiceJob_Extension {      /// <summary>      ///       /// </summary>     public void run()     {         CustInvoiceTable                    custInvoiceTableLoc;         CustParameters                      custParameters = CustParameters::find();         MarkupTrans                         markupTrans;         if (custParameters.AdvanceStampDutyManagement_Custom)         {             CustFreeInvoiceCalcTotals   custFreeInvoiceCalcTotals;   ...

Create ledger dimension from main account

From Bank account :   offsetLedgerDim = DimensionStorage::getDynamicAccount( ‘USMF',LedgerJournalACType::Bank); From Main account : DimensionDynamicAccount DimensionDynamicAccount; DimensionDynamicAccount = LedgerDynamicAccountHelper::getDynamicAccountFromAccountNumber("000103", LedgerJournalACType::Ledger); Likewise the second parameter can be changed to get the ledger dimension from the different account types.