Posts

How to get any Report Name from Print Management in D365 FO x++

   private PrintMgmtReportFormatDescription getReportFormatDescription(PrintMgmtDocumentType _docType)   {       PrintMgmtReportFormatDescription printMgmtReportFormatDescription;       RecId printMgmtDocInstanceRecId = PrintMgmtDocInstance::getPrintMgmtDocRecId(           0,           0,           PrintMgmtNodeType::Sales,           _docType,           PrintMgmtDocInstanceType::Original);       if (printMgmtDocInstanceRecId)       {           PrintMgmtReportFormat printMgmtReportFormat;           PrintMgmtSettings printMgmtSettings;           select firstonly Description, SSRS from printMgmtReportFormat               exists join printMgmtSettings           ...

Generate Public URL of Attachment expose to 3rd parties without authentication

  internal final class TestClassV2 {     /// <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)     {         int64 _recId=22565437142; // refer to a record present in inventable  eg released product         DocuRef docuRef;         EcoResProductImage ecoResProductImage; // there can be multiple images against a product so we only creating url of image that is by default         select firstOnly docuRef     join ecoResProductImage         where ecoResProductImage.DefaultImage == NoYes::Yes         ...

get product image in D365 FO x++

  public str getProductImage(ItemId _itemId)     {         str                 imageBase64;         InventTable         inventTable = InventTable::find(_itemId);         EcoResProduct       product;         Common              firstRecord;         Common              secondRecord;         product             = EcoResProduct::find(inve...

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"); }