Posts

Showing posts from February, 2025

How to create Extension of Batch job class in D365 FO x++

 [ExtensionOf(classStr(DSProcessNotificationsBatch))] final class DSProcessNotificationsBatch_Timesheet_Extension {     public DialogField dfProcessAbsent;     public DialogField dfProcessInvalidAttendance;     public DialogField dfProcessLeave;     public DSTSProcessAbsent ProcessAbsent;     public DSTSProcessInvalidAttendance ProcessInvalidAttendance;     public DSTSProcessLeave ProcessLeave;     #define.CurrentVersion(4)     #localmacro.CurrentList         ProcessAbsent,         ProcessInvalidAttendance,         ProcessLeave     #endmacro                      Public Object dialog()     {         DialogRunbase dialog   = next dialog();         dfProcessAbsent = dialog.addFieldValue(extendedTypeStr(DSTSProcessAbsent), Pr...

get attachment from DocuRef in D365 FO

  container fileCon = DocumentManagement::getAttachmentAsContainer(_docuRef);

how to generate SSRS Report and store it in attachment table(DocuRef)

  class RunReportToStreamTest { public static void main(Args _args) { DocuRef addedRecord; ProdTable prodTable = ProdTable::find('P00017 3'); Filename fileName = "AbcTest.pdf"; YourReportController controller = new YourReportController(); YourReportContract contract = new YourReportContract(); SRSPrintDestinationSettings settings; Array arrayFiles; System.Byte[] reportBytes = new System.Byte[0](); SRSProxy srsProxy; SRSReportRunService srsReportRunService = new SrsReportRunService(); Microsoft.Dynamics.AX.Framework.Reporting.Shared.ReportingService.ParameterValue[] parameterValueArray; Map reportParametersMap; SRSReportExecutionInfo executionInfo = new SRSReportExecutionInfo(); ; _args =...

SysDaQueryObject is also used instead of query class

 SysDaQueryObject   is used instead of Query and used for heavy operations Example of  using SysDaQueryObject. public void updateEmployeePosition(Common _table, str _mappingFieldStr, str _joinFieldStr)     {         Common              updateTable;         DirPerson           person;         HcmWorker           worker;         HcmPosition         position;         HcmPositionDetail   positionDetail;         HcmJobDetail        jobDetail;         str                 mappingField;         str                 joinField;         HcmPositionWorkerAss...

Auto Approve the workflow if a user already approve it in an hierarchy of Wotkflow

public void insert() {     next insert();     switch(this.RefTableId)     {         case tableNum(PurchReqTable):         case tableNum(PurchTable):         {             if(this.CheckForApproval(this.CorrelationId, this.UserId))             {                 WorkflowWorkItemActionManager::dispatchWorkItemAction(this, 'Auto Approve', this.UserId, WorkflowWorkItemActionType::Complete, this.MenuItemName);             }         }     } } public workflowtrackingtable CheckForApproval(WorkflowCorrelationId _correlationId, UserId _UserId) {     Workflowtrackingstatustable workflowtrackingstatustable;     Workflowtrackingtable       workflowtrackingtable;     select firstonly  workflowtrackings...

how to show query in form so can add filter and than store it in a field in d365 Fo x++

 public void showQuery()     {         DMFDefinitionGroupEntity dmfDefGroupEntity;                      dmfDefGroupEntity = this.parmDefGroupEntityDataSource().cursor() as DMFDefinitionGroupEntity;         dmfDefGroupEntity.reread();         var queryData = dmfDefGroupEntity.QueryData;         if (!queryData)         {             queryData = DMFUtil::getDefaultQueryForEntityV3(dmfDefGroupEntity.Entity, dmfDefGroupEntity.DefinitionGroup, '', false);         }                      queryData = DMFFormBrowser::showQuery(queryData);         if(queryData != connull())         {             ttsbegin;             dmfDefGroupE...

How to see the query of view in Sql Server in d365 FO

 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.ViewName')   and o.type      = 'V'

command to generate certificates to extents VM in D365 FO

Image
  New-SelfSignedCertificate -Subject "CN=*.cloud.onebox.dynamics.com,O=Microsoft Corporation,L=Redmond,S=WA,C=US" -DnsName "*.cloud.onebox.dynamics.com", "usnconeboxax1ecom.cloud.onebox.dynamics.com", "usnconeboxax1pos.cloud.onebox.dynamics.com", "usnconeboxax1ret.cloud.onebox.dynamics.com" -CertStoreLocation "cert:\LocalMachine\My" -KeyUsage DataEncipherment, KeyEncipherment, DigitalSignature  -HashAlgorithm "SHA384"  -KeyAlgorithm RSA -KeyLength 2048 -NotAfter (Get-Date).AddYears(5) Run this command in Power shell than Open manage computer certificates go to certificates in personcal from there copy the one certificate which we generated from above command  than go to Trusted Root  Certificates  in Certificates paste the copy one than go to iis and open AOSService than click on binding on right side pane. than select the listed one and click on edit  thank select the SSL one which we have generated and click ok  on...