Posts

Showing posts from March, 2025

model import/Export Command in D365 FO

 ModelUtil.exe -export -metadatastorepath=C:\AosService\PackagesLocalDirectory -modelname="DSHR" -outputpath=c:\Rafay ModelUtil.exe -import -metadatastorepath=C:\AosService\PackagesLocalDirectory -file=C:\DSAzaqPayrollCustomization.axmodel ModelUtil.exe -replace -metadatastorepath=C:\AosService\PackagesLocalDirectory -file=C:\DSAzaqPayrollCustomization.axmodel ModelUtil.exe -delete -metadatastorepath=C:\AosService\PackagesLocalDirectory -modelname="DSSPayroll"

create movement journal through code in d365 FO x++

  One of the most common requirements these days is to create Inventory Movement Journal through code. Mostly when the input is coming from another 3rd Party application. Here is the code show below :-        InventJournalTable              inventJournalTable;        InventJournalTrans              inventJournalTrans;        InventJournalNameId             inventJournalName;        InventDim                            inventDim;        JournalCheckPost               journalCheckPost;              // Creation of Inventory Journal Header              inventJournalTable.clear();         ...

method response to validate the values is in warehouse app is Processcontrol()

    exist in class  WHSWorkExecuteDisplay but some menu Item classes overwrite this . public boolean processControl(WhsControl _control, str _value)   {       var fieldValues = _control.parmContext().fieldValues;       var controlData = _control.parmContext().controlData;       switch (true)       {           case _control is WhsControlQty:               Qty qty = WHSWorkExecuteDisplay::str2numDisplay(_value);               if (qty > controlData.getQty() &&                   (!InventTable::find(fieldValues.parmItemId()).whsAllowPhysNeg() ||                   !WMSLocation::find(fieldValues.parmWMSLocationId(), fieldValues.parmInventLocationId()).whsLocationProfile().AllowNegative))         ...

code to sechedule batch job through code

  BatchHeader batchHeader; BatchInfo localBatchInfo; CustumBatch updateBatch = new CustumBatch(); SysRecurrenceData sysRecurrenceData = SysRecurrence::defaultRecurrence(); sysRecurrenceData = SysRecurrence::setRecurrenceEndAfter(sysRecurrenceData, 1); localBatchInfo = updateBatch.batchinfo(); batchHeader = batchHeader::construct(); batchHeader.addTask(updateBatch); batchHeader.parmRecurrenceData(sysRecurrenceData); batchHeader.save(); Info("Batch job created");

Change the D365 FO Dev VM Name But visual studio is not wokring

Image
 First Open the Web.config file in notepad and search the old VM name in it than replce it with new one  than open the sql server configration manager and enabled these all three protocol. than open ssms and run this EXEC sp_dropserver 'Old-PC-Name'; EXEC sp_addserver 'New-PC-Name', 'local';

how to make load id filter able on sales line in D365 FO

 What we have to do create a view of sales line  in view add inventTransId and one Coumputed column LoadId than write this computed method in this   public static server str lastLoadId()  {      SysDictTable WHSLoadLineDT = new SysDictTable(tableNum(WHSLoadLine));        DictView dv = new DictView(tableNum(SalesLineLoadIdView));        str s = strFmt('SELECT TOP 1 %1 FROM %2 WHERE %2.%3 = %4 AND %2.%5 = %6 ORDER BY %7 DESC',      WHSLoadLineDT.fieldName(fieldNum(WHSLoadLine, LoadId), DbBackend::Sql),      WHSLoadLineDT.name(DbBackend::Sql),      WHSLoadLineDT.fieldName(fieldNum(WHSLoadLine, InventTransId), DbBackend::Sql),      dv.computedColumnString(tableStr(SalesLine), fieldStr(SalesLine, InventTransId), FieldNameGenerationMode::WhereClause),      WHSLoadLineDT.fieldName(fieldNum(WHSLoadLine, InventTransType), DbBackend::Sql), ...