Posts

how to sync FO custom field in D365 fo Retail Database

Image
so i have a requirement to push extension field data to channel database so we can use in POS side. for this what i have done is defined below these are the custom field in D365 fo table. to Push these field to retail I have created a custom table in FO in which we have the same custom field which we required in POS side . this is the custom table contain all that custom field  and save data per company is set to no a custom field is created for dataareaId  due to some reasons. After that create a code extention of CustParamter Table and did this code to insert and update data in Or custom table. [ExtensionOf(tableStr(CustParameters))] final class CustParameters_SIL_TUCustomizations_Extension {     void update()     {         next  update();         this.createOrUpdateTUCustParametersExt(this);     }     public void createOrUpdateTUCustParametersExt(CustParameters _CustParameters)   ...

Check if the current user has a specific role or not via X++ in Microsoft Dynamics 365 F&O

  UserInfo userInfo; SecurityUserRole securityUserRole; SecurityRole Roles; boolean allowed; select id from userInfo join SecurityRole from securityUserRole where securityUserRole.User == userInfo.Id join Roles where Roles.RecId == securityUserRole.SecurityRole && (Roles.AotName =='ROLENAME') && UserInfo.id == curUserId(); if(UserInfo.id == curUserId()) { Allowed = true; }

How to get user to whom workflow is assigned using X++ in Dynamics 365 Finance & Operation

  public WorkflowUser isWorkflowApprover(Common _common) { WorkflowTrackingStatusTable workflowTrackingStatusTable; WorkflowTrackingTable workflowTrackingTable; select firstonly RecId from workflowTrackingStatusTable join User from workflowTrackingTable order by WorkflowTrackingTable.CreatedDateTime desc where workflowTrackingTable.WorkflowTrackingStatusTable == workflowTrackingStatusTable.RecId && workflowTrackingStatusTable.ContextRecId == _common.RecId && workflowTrackingStatusTable.ContextTableId == _common.TableId && workflowTrackingTable.TrackingContext == WorkflowTrackingContext::WorkItem; return workflowTrackingTable.User; }

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