Requirement
DPL & ZPL Label printing from D365 Finance and operation browser using X++ Class.
Prerequisite
Install Document Routing Agent & at-least one active printer should be there in your D365 Finance and operation environment.
https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/analytics/install-document-routing-agent
Sample Code
WhsDocumentRouting::printLabelToPrinter(“Your Active Printer Name”, ‘Your String or text’);
https://docs.microsoft.com/en-us/business-applications-release-notes/april19/dynamics365-finance-operations/advanced-wave-label-print
Like this:
Like Loading...
Requirement & Issue
Data Entity Staging Tables clean up is one of the most important maintenance activities.The amount of data stored in a database has a great impact on its performance.Huge and unnecessary data can lead to slowness & decrease performance of the D365 Finance and operation.
There is no standard functionality & fast way to clean unnecessary data & records from Data Entity Staging Tables Using Direct SQL.
Sample Program
Below program is fastest way to truncate all the Data Entity Staging Tables in one go using direct SQL.
**** you can modify the below program as per your need***
[code language=”cpp”]
class ACXDataStagingCleanUpTableClass
{
public void operation()
{
DMFEntity DMFEntity;
RecId oldRecId;
try
{
while select * from DMFEntity
order by RecId asc
where DMFEntity.RecId > oldRecId
{
oldRecId = DMFEntity.RecId;
if (DMFEntity.EntityTable like ‘*Staging’)
this.cleanUp(Global::tableName2Id(DMFEntity.EntityTable));
}
}
catch
{
retry;
}
}
public void cleanUp(int _tableName)
{
Connection connection = new Connection();
Statement statement;
int resultSet;
int rowCount;
str sql = strFmt(‘TRUNCATE TABLE %1;’, new DictTable(_tableName).name(DbBackend::Sql));
statement = connection.createStatement();
new SqlStatementExecutePermission(sql).assert();
resultSet = statement.executeUpdate(sql);
CodeAccessPermission::revertAssert();
statement.close();
}
}
[/code]
Like this:
Like Loading...
Microsoft Dynamics AX, Microsoft Dynamics 365 for Finance and Operations, D365 FO, Retail, SQL, Microsoft Power Apps, Microsoft Power BI, Microsoft Azure, Logic Apps, Microsoft Flow, Microsoft power automate, Microsoft Power Platform,.Net, X++, C#, Power BI DAX, Data Warehousing, Microsoft Analysis Services, SQL Server Reporting Services