Posts

Showing posts from November, 2025

Deploy Reports of specfic model

 C:\AOSService\PackagesLocalDirectory\Plugins\AxReportVmRoleStartupTask\DeployAllReportsToSSRS.ps1 -PackageInstallLocation "C:\AOSService\PackagesLocalDirectory" -Module DSTasaruCustomization

get view defination from SQL in x++

 select definition from sys.objects     o join sys.sql_modules m on m.object_id = o.object_id where o.object_id = object_id( 'dbo.DSPWorkerDetailView')   and o.type      = 'V'

Call any method of class in D365 FO x++

 public anytype callClassMethod(ClassId _classId, MethodName _methodName, boolean isInstanceMethod, Common _record) {      anytype returnObject;      SysDictClass dictClass = new SysDictClass(_classId);        if(isInstanceMethod)      {          returnObject = dictClass.callObject(_methodName, classFactory.createClass(_classId), _record.TableId, _record.RecId);      }      else      {          returnObject = dictClass.callStatic(_methodName, _record.TableId, _record.RecId);      }        return returnObject; } Example:   public str getApproverNames(Common _record)   {       str name;         name = this.callClassMethod(className2Id('DSSWor...

to fix reserved item in D365 FO x++ (Recalculate Inventory)

i mistakenly delete some SO line from sales order through SSMS but lines item are reserved . now what happened they do not going to unreserve  what i did is to delete related record from inventTrans and inventtransOrigin  than run the script below to fix it. Now it works.   static void InventSum_Recalculate(Args _args)   { InventSumRecalcItem InventSumRecalcItem; InventTable _InventTable; while select * from _InventTable where _InventTable.ItemId == 'DPID0000040' { ttsBegin; InventSumRecalcItem = new InventSumRecalcItem(_InventTable.ItemId, true, checkfix::fix); InventSumRecalcItem.updatenow(); ttsCommit; } info("Done"); }