• Skip to main content
  • Skip to primary sidebar
  • Home
  • About
  • Recommended Readings
    • 2022 Book Reading
    • 2023 Recommended Readings
    • Book Reading 2024
    • Book Reading 2025
  • Supply Chain Management Guide
  • PKM
  • Microsoft Excel

Ali Raza Zaidi

A practitioner’s musings on Dynamics 365 Finance and Operations

Dynamics 365 for Operations

Calling menu name in Extensions Dynamics 365 for finance and operations

March 23, 2019 by alirazazaidi

In Ax 2012 we get menu name with element.Args().CallMenu name, using  taking decision on menu name.

 

But same logic we need to apply in Extension. But in D365 For finance and operations we did not overlay. Following code snippet helps me to implement similar logic in Extension.

 

 

[ExtensionOf(formStr(CustTable))]

final class IaLogisticsContactInfoGrid_Extension

{

 

 

/// <summary>

///

/// </summary>

/// <param name=”sender”></param>

/// <param name=”e”></param>

[FormEventHandler(formStr(LogisticsContactInfoGrid), FormEventType::Initialized)]

public static void LogisticsContactInfoGrid_OnInitialized(xFormRun sender, FormEventArgs e)

{

 

FormRun formRun = sender;

 

;

 

info(formRun.args().menuItemName());

}

 

}

Journal name . does not support journal type Daily X++ Dynamics 2012 r3

March 23, 2019 by alirazazaidi

Hi did one customization, where I create Ledger Journal using X++ code. It was working perfectly fine with Ledger General Ledger entries. But threw error  on creating Ledger for AR,PR Payment.

 

I created ledger with following code snippet.  But it works only for Ledger for of Type Daily

 

AxLedgerJournalTable    header  = new AxLedgerJournalTable();
AxLedgerJournalTrans    trans   = new AxLedgerJournalTrans();

container               offsetDim;
LedgerJournalNameId     ledgerJournalNameId = “payment”;

header.parmJournalName(ledgerJournalNameId);
header.parmJournalType(LedgerJournalType::CustPayment);
header.save();

I replaced the above code with following snippet it works perfectly fine, rest of the code is works fine

LedgerJournalName ledgerJournalName;
LedgerJournalTable ledgerJournalTable;
LedgerJournalTrans ledgerJournalTrans;

select firstonly ledgerJournalName
where ledgerJournalName.JournalName == parameters.LedgerJournalNameId &&
ledgerJournalName.JournalType == LedgerJournalType::CustPayment;
if(!ledgerJournalName.RecId)
throw error(“@CAM184”);
if(ledgerJournalName)
{
ledgerJournalTable.JournalName = ledgerJournalName.JournalName;
ledgerJournalTable.Name = ledgerJournalName.Name;
ledgerJournalTable.insert();
}

In keyword While select statement X++ Dynamics 365 for finance and operations

March 20, 2019 by alirazazaidi

Hi  Today I found very interesting post here , where we can use “In” keyword for While select or Select statement.

in will be enum based.

SalesTable  salesTable;
container   con = [SalesType::Sales, SalesType::ReturnItem, SalesType::Subscription];
while select * from salesTable
where salesTable.SalesType in con
{
Info(salesTable.SalesId);
}
reference :

https://allaboutmsdynamics.wordpress.com/2019/02/18/d365-ax7sql-in-operator-in-x-where-clause-enum-fields-only/

Paging in Query X++ Dynamics 365 for finance and operations

March 4, 2019 by alirazazaidi

For paging in X++ Query. There are three steps required. Rest of Query Code is same.

We have to set following things in Query data source

  • Set Sort field in Query data Source.
  • Paging position property of QueryRun is set to true.
  • Add page range with starting position and number of records in QueryRun

Here is code snippet

 

  QueryBuildRange qbr,qbrStartDate,qbrEndDate;
QueryBuildDataSource qbd;
IAPageSize EnumPageSize;

QueryRun        qr;

Query           query = new Query();

Int pageSize = 2;

 

qbd = query.addDataSource(TableNum(ProjPlanVersion));
qbd.addOrderByField(fieldNum(ProjPlanVersion,HierarchyId));

qr = new QueryRun(query);

qr.enablePositionPaging(true);
            CurrentPageNumber =1;
            startingposition = CurrentPageNumber * pagesize;
            qr.addPageRange(startingposition, totalRows);
while(qr.next())

 

{

 

Info (“”);

}

Cannot stop DynamicsAxBatch service on computer Dynamics 365 for finance and operations

February 23, 2019 by alirazazaidi

I still like the Idea shared by “Gary Vaynerchuk ” Post ” Document dont create” So I document what I face today and resolved.

 

Today I am facing Project compilation Error in Visual studio output pane, I am struggling to understand Table control, so I can meet the development of my next assignment.  Error was

 

 

 

Severity        Code        Description        Project        File        Line        Suppression State

Error                One or more errors occurred. —> System.InvalidOperationException: Cannot stop DynamicsAxBatch service on computer ‘.’. —> System.ComponentModel.Win32Exception: The service cannot accept control messages at this time

— End of inner exception stack trace —

at System.ServiceProcess.ServiceController.Stop()

 

When I open Services, I found that DynamicsAXBatch services is in stopping mode and stuck.

 

So I killed the service process with CMD command. “taskkill /f /pid [pid number]”

 

The message already shows the service name. ” DynamicsAXBatch” You can copy it from Service detail dialog.

 

So Open CMD with run as administrator and run the following command and get  pid

 

sc queryex DynamicsAxBatch

 

Now I have IP.

 

And kill the Process Id

 

taskkill /f /pid 5352

 

Now I start the service again.

Project is successfully complied.

 

Dynamics Ax 2012 R3 Contoso Demo VM license 2019

February 22, 2019 by alirazazaidi

Today I need to explore some control sample in Dynamics ax 2012 R3. For opening Ax 2012 r3 on my machine, I need a demo license.

I found demo license for 2019 on following location.

How to capture Fiddler logs for Dynamics 365 for finance and operations

February 21, 2019 by alirazazaidi

Here is another tip, how to capture for Finance and operations. You can download fiddlerCap from below link

 

http://www.telerik.com/fiddler/fiddlercap

 

 

Data source filter using extension Dynamics 365 for finance and operations

February 4, 2019 by alirazazaidi

Hi every one, Today I have very small tip. During customization we need to add filters at run time. Specially in the case of inquiry forms. But Now we have to work with extension. Extensions are much more powerful then over layering.

 

So first one thing to copy Datasource  OnQueryEXecuting event. And paste in Extension class.

The sample code snippet is here.

 

 

 

 [FormDataSourceEventHandler(formDataSourceStr(HcmDiscussion, HcmTopicRef), FormDataSourceEventType::QueryExecuting)]

public static void HcmTopicRef_OnQueryExecuting(FormDataSource sender, FormDataSourceEventArgs e)

{

FormRun          HcmDiscussionForm = sender.formRun();

sender.query().dataSourceName(sender.name()).addRange(fieldnum(HcmTopicRef,     HeadingRefRecId)).value(queryValue(_heading.RecId));

}

Report menu item is not found when constructing the query string” Dynamics 365 for finance and operations.

February 3, 2019 by alirazazaidi

I found following error, while running custom report.

 

 

 

Following message shown message.

 

 

 

Report run from controller class.  I found “controller.parmArgs(_args);” was missing. That reason report threw this error.

 

Complete code will be similar.

 

 

 

 

        contract.parmRecordId(invoiceJour.RecId);

controller.parmArgs(_args);

 

controller.parmReportName(ssrsReportStr(DSSCompletionCertificate, Design));

controller.parmShowDialog(false);

controller.parmReportContract().parmRdpContract(contract);

controller.startOperation();

error : Can’t start service W3SVC on computer ‘.’. Dynamics 365 for finance and operations.

January 24, 2019 by alirazazaidi

I got error on My Dev box virtual machine. When I tried to restart AOS or IIS service.

 

 

I found that World wide web service is in stopping mode. Some reason it stuck. So I restart my machine.

AOS/ IIS works perfectly fine after restart. Basically two services need to run if you found this error

 

  • IIS admin service.
  •  World wide web service

 

« Previous Page
Next Page »

Primary Sidebar

About

I am Dynamics AX/365 Finance and Operations consultant with years of implementation experience. I has helped several businesses implement and succeed with Dynamics AX/365 Finance and Operations. The goal of this website is to share insights, tips, and tricks to help end users and IT professionals.

Legal

Content published on this website are opinions, insights, tips, and tricks we have gained from years of Dynamics consulting and may not represent the opinions or views of any current or past employer. Any changes to an ERP system should be thoroughly tested before implementation.

Categories

  • Accounts Payable (2)
  • Advance Warehouse (2)
  • Asset Management (3)
  • Azure Functions (1)
  • Books (6)
  • Certification Guide (3)
  • Customization Tips for D365 for Finance and Operations (62)
  • D365OF (59)
  • Data Management (1)
  • database restore (1)
  • Dynamics 365 (58)
  • Dynamics 365 for finance and operations (135)
  • Dynamics 365 for Operations (165)
  • Dynamics AX (AX 7) (134)
  • Dynamics AX 2012 (274)
  • Dynamics Ax 2012 Forms (13)
  • Dynamics Ax 2012 functional side (16)
  • Dynamics Ax 2012 Reporting SSRS Reports. (31)
  • Dynamics Ax 2012 Technical Side (52)
  • Dynamics Ax 7 (65)
  • Exam MB-330: Microsoft Dynamics 365 Supply Chain Management (7)
  • Excel Addin (1)
  • Favorites (12)
  • Financial Modules (6)
  • Functional (8)
  • Implementations (1)
  • Lifecycle Services (1)
  • Logseq (4)
  • Management Reporter (1)
  • Microsoft Excel (4)
  • MS Dynamics Ax 7 (64)
  • MVP summit (1)
  • MVP summit 2016 (1)
  • New Dynamics Ax (19)
  • Non Defined (9)
  • Note taking Apps (2)
  • Obsidian (3)
  • Personal Knowledge Management (2)
  • PKM (14)
  • Power Platform (6)
  • Procurement (5)
  • procurement and sourcing (5)
  • Product Information Management (4)
  • Product Management (6)
  • Production Control D365 for Finance and Operations (10)
  • Sale Order Process (10)
  • Sale Order Processing (9)
  • Sales and Distribution (5)
  • Soft Skill (1)
  • Supply Chain Management D365 F&O (3)
  • Tips and tricks (278)
  • Uncategorized (165)
  • Upgrade (1)
  • Web Cast (7)
  • White papers (4)
  • X++ (7)

Copyright © 2025 · Magazine Pro On Genesis Framework · WordPress · Log in