Posts

Showing posts from February, 2024

Print Management in D365fo X++

 Print Management in D365fo X++ Code:  Internal static class PrintMgmtDelegatesHandler_DSSL_Class_Extension {     [SubscribesTo(classstr(PrintMgmtDocType), delegatestr(PrintMgmtDocType, getDefaultReportFormatDelegate))]     public static void getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)     {         if(_docType == PrintMgmtDocumentType::SalesOrderInvoice                 && (curExt() == "5030" || curExt() == "USMF"))         {            _result.result(ssrsReportStr(DSSLSalesInvoiceReport, SLPrecisionDesign));             //_result.result(ssrsReportStr(DSSLSalesInvoiceReport, CustomerCredetNote));         } } } Code(OR): [ExtensionOf(classStr(PrintMgmtDelegatesHandler))] public final class PrintMgmtDelegatesHandler_DSA_Class_...

FO Model Commands in D365fo X++

 Model Commands in D365fo X++ .\ModelUtil.exe -import -metadatastorepath=C:\AosService\PackagesLocalDirectory -file=C:\Junaid\ABC.axmodel .\ModelUtil.exe -export -metadatastorepath=C:\AosService\PackagesLocalDirectory -modelname="ABC" -outputpath=c:\Junaid .\ModelUtil.exe -replace -metadatastorepath=C:\AosService\PackagesLocalDirectory -file=C:\Junaid\ABC.axmodel .\ModelUtil.exe -delete -metadatastorepath=C:\AosService\PackagesLocalDirectory -file=C:\Junaid\ABC.axmodel 

Change XML file value with excel file value through power shell script

Change XML file value with excel file value through power shell script Script:  # Load the Excel PowerShell module Import-Module -Name ImportExcel # Path to the Excel file $excelFilePath = "C:\Users\Administrator\Desktop\Test.xlsx" # Path to the XML file $xmlFilePath = "C:\Users\Administrator\Desktop\SalesTable.SizeWiseYield.xml" # Load the Excel file $excelData = Import-Excel -Path $excelFilePath # Read the content of the XML file $xmlContent = Get-Content -Path $xmlFilePath # Iterate through each cell in the Excel file foreach ($row in $excelData) { foreach ($cell in $row.PSObject.Properties) { $cellValue = $cell.Value # Construct the pattern to match <Name>CellValue</Name> $pattern = "<Name>$cellValue</Name>" # Replace the value in the XML file with "DS_CellValue" if it matches $xmlContent = $xmlContent -replace [regex]::Escape($pattern), "<Name>DS_$cellValue...

Filter Data on the base of different Menu Items in D365fo X++

 Filter Data on the base of different Menu Items in D365fo X++ Code:  /// <summary> /// /// </summary> public void run() { super(); if(element.args().menuItemName() == menuItemDisplayStr(_OMnuSampleRecipe)) { QueryBuildRange qbds = _RecipeTable_ds.query().dataSourceTable(tableNum(_RecipeTable)).addRange(fieldNum(_RecipeTable, VersionRecipe)); qbds.value(queryValue(VersionRecipe::Sample)); qbds.status(RangeStatus::Locked); } else if(element.args().menuItemName() == menuItemDisplayStr(_OMnuProtoRecipe)) { QueryBuildRange qbds = _RecipeTable_ds.query().dataSourceTable(tableNum(_RecipeTable)).addRange(fieldNum(_RecipeTable, VersionRecipe)); qbds.value(queryValue(VersionRecipe::Proto)); qbds.status(RangeStatus::Locked); } else if(element.args().menuItemName() == menuItemDisplayStr(_OMnuTransitionWashRecipe)) ...