• 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 finance and operations

How to create a legal Entity In Dynamics 365 for finance and Operations.

January 27, 2021 by alirazazaidi

Hi Everyone, Welcome to this session. In this session, going to create a legal Entity.

Legal Entity creation is very simple.

Before that we go let’s discuss what a legal entity is.

•A legal entity is an organization that has a registered or legislated legal structure. 

•They have to go into a legal contract with another organization and are required to prepare reports on their performance.

•In D365 Country/region is the most important factor while creating a new legal entity.  All localization in Dynamics 365 for finance and operations depend on Country and region. It activates with respect to selection of Region.

•Form inquiries, reports enable disabled with respect to region or country selection.

Every legal entity is associated with Company Id, which is 4 character value. Once it created can not be modify. Rest of things we can modify.

How to restore a Production database to the DevBox environment Dynamics 365 For Finance and Operations

March 27, 2020 by alirazazaidi

This blog post is for my notes, you can find more details on Microsoft link.

There are some extra steps in the Microsoft link, which I never used. I usually follow only these steps and it works for me. So Instead I need to search on Microsoft link. I wrote this post for my future use.

Step 1: You have to restore production database to UAT and then from uat to export it to Asset library

Step 2: Download Backpac file in specific location

Step 3:  Open Command prompt with run as administrator for locally hosted VM and go to following location

Cd C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin

Step 4: run the following command

SqlPackage.exe /a:import /sf:D:\Exportedbacpac\my.bacpac /tsn:localhost /tdn:<target database name> /p:CommandTimeout=1200

I modified the above statement as

SqlPackage.exe /a:import /sf:C:\Temp\hsauatbackup.bacpac /tsn:localhost /tdn:AxDb_6 /p:CommandTimeout=1200

Step 5: run the following command.

After the database is restored. Run the following command in SQL Server management

CREATE USER axdeployuser FROM LOGIN axdeployuser
EXEC sp_addrolemember 'db_owner', 'axdeployuser'

CREATE USER axdbadmin FROM LOGIN axdbadmin
EXEC sp_addrolemember 'db_owner', 'axdbadmin'

CREATE USER axmrruntimeuser FROM LOGIN axmrruntimeuser
EXEC sp_addrolemember 'db_datareader', 'axmrruntimeuser'
EXEC sp_addrolemember 'db_datawriter', 'axmrruntimeuser'

CREATE USER axretaildatasyncuser FROM LOGIN axretaildatasyncuser
EXEC sp_addrolemember 'DataSyncUsersRole', 'axretaildatasyncuser'

CREATE USER axretailruntimeuser FROM LOGIN axretailruntimeuser
EXEC sp_addrolemember 'UsersRole', 'axretailruntimeuser'
EXEC sp_addrolemember 'ReportUsersRole', 'axretailruntimeuser'

CREATE USER axdeployextuser FROM LOGIN axdeployextuser
EXEC sp_addrolemember 'DeployExtensibilityRole', 'axdeployextuser'

CREATE USER [NT AUTHORITY\NETWORK SERVICE] FROM LOGIN [NT AUTHORITY\NETWORK SERVICE]
EXEC sp_addrolemember 'db_owner', 'NT AUTHORITY\NETWORK SERVICE'

UPDATE T1
SET T1.storageproviderid = 0
    , T1.accessinformation = ''
    , T1.modifiedby = 'Admin'
    , T1.modifieddatetime = getdate()
FROM docuvalue T1
WHERE T1.storageproviderid = 1 --Azure storage

DROP PROCEDURE IF EXISTS SP_ConfigureTablesForChangeTracking
DROP PROCEDURE IF EXISTS SP_ConfigureTablesForChangeTracking_V2
GO
-- Begin Refresh Retail FullText Catalogs
DECLARE @RFTXNAME NVARCHAR(MAX);
DECLARE @RFTXSQL NVARCHAR(MAX);
DECLARE retail_ftx CURSOR FOR
SELECT OBJECT_SCHEMA_NAME(object_id) + '.' + OBJECT_NAME(object_id) fullname FROM SYS.FULLTEXT_INDEXES
    WHERE FULLTEXT_CATALOG_ID = (SELECT TOP 1 FULLTEXT_CATALOG_ID FROM SYS.FULLTEXT_CATALOGS WHERE NAME = 'COMMERCEFULLTEXTCATALOG');
OPEN retail_ftx;
FETCH NEXT FROM retail_ftx INTO @RFTXNAME;

BEGIN TRY
    WHILE @@FETCH_STATUS = 0 
    BEGIN 
        PRINT 'Refreshing Full Text Index ' + @RFTXNAME;
        EXEC SP_FULLTEXT_TABLE @RFTXNAME, 'activate';
        SET @RFTXSQL = 'ALTER FULLTEXT INDEX ON ' + @RFTXNAME + ' START FULL POPULATION';
        EXEC SP_EXECUTESQL @RFTXSQL;
        FETCH NEXT FROM retail_ftx INTO @RFTXNAME;
    END
END TRY
BEGIN CATCH
    PRINT error_message()
END CATCH

CLOSE retail_ftx; 
DEALLOCATE retail_ftx; 

Delete the AXDB. Create backup.

Rename current database to AXDB

How to enabled document attached on processed records Dynamics 365 for finance and operations

March 9, 2020 by alirazazaidi

In many cases, document attachment disabled on processed records. Usually this happened with respect to business requirements. For example when Purchased order invoiced and settled in ledger, attachment add, edit and delete can be disabled. Only existing attachment can be view on these documents.But some cases we have to forcefully enabled document attachment on these processed records.

I used following code snippet to enable the document attachment.

/ <param name="args"></param>
    [PostHandlerFor(formStr(DocuView), formMethodStr(DocuView, setEnabled))]
    public static void DocuView_Post_setEnabled(XppPrePostArgs args)
    {
        FormRun formRun; 
			//= sender;
        formRun  =Args.getThis();
        formrun.design().controlName("ctrlAdd").enabled(true);
        FormDataSource      DocuRef_DS =formRun.dataSource("DocuRef");
        DocuRef_DS.allowEdit(true);
        DocuRef_DS.allowCreate(true);
        DocuRef_DS.allowDelete(true);

    }

Custom lookup UIBuilder SSRS RDP Dynamics 365 for finance and operations

March 4, 2020 by alirazazaidi

Hi, Today I have simple code snippet to create a custom lookup in SSRS Reports in Dynamics 365 for finance and operations.

public class MyUIBuilder extends SrsReportDataContractUIBuilder
{

    private DialogField vendordf,dialogbranch;
    
    MyDC     contract;
    public void postBuild()
    {
        super();

        contract = this.dataContractObject();

        // binding dialogs with contract fields

        vendordf = this.bindInfo().getDialogField(this.dataContractObject(),
            methodStr(MyDC, parmHcmPerfPeriodId));
        dialogbranch = this.bindInfo().getDialogField(this.dataContractObject(),
            methodStr(MyDC, parmOMOperatingUnitNumber));

       dialogbranch.registerOverrideMethod(methodStr(FormStringControl,lookup),methodStr(BEHCMReviewUIBuilder,divisionCodeLookup),this);

  
        vendordf.registerOverrideMethod(methodStr(FormStringControl,lookup),methodStr(BEHCMReviewUIBuilder,PerfPeriodIdLookup),this);
       
    }

    public void postRun()
    {
    
    }

 
    private void PerfPeriodIdLookup(FormStringControl divisionCodeLookup)
    {
        Query                   query = new Query();
        QueryBuildDataSource    qbd, qbdPerson;
            QueryBuildDataSource qbds;
        QueryBuildDataSource qbdsJoin;
        SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(HcmPerfPeriod), divisionCodeLookup);
        qbds= query.addDataSource(tableNum(HcmPerfPeriod));
          sysTableLookup.parmQuery(query);
           sysTableLookup.addLookupfield(fieldNum(HcmPerfPeriod, PerfPeriodId), true);
     
        sysTableLookup.parmQuery(query);
        sysTableLookup.parmUseLookupValue(False);
        sysTableLookup.performFormLookup();
    }

    private void divisionCodeLookup(FormStringControl divisionCodeLookup)
    {
        Query          query;
        QueryBuildDataSource  qbds,qbds1;
        SysTableLookup     sysTableLookup;
        DimensionAttribute   dimAttr;
        ;
        sysTableLookup = SysTableLookup::newParameters(tablenum(OMOperatingUnit),divisionCodeLookup);
        sysTableLookup.addLookupfield(fieldnum(OMOperatingUnit, OmoperatingunitNumber));
        sysTableLookup.addLookupfield(fieldNum(OMOperatingUnit,Name));
        query = new Query();
        qbds = query.addDataSource(tableNum(OMOperatingUnit));
        qbds.addRange(fieldNum(OMOperatingUnit, OMOperatingUnitType)).value(queryvalue(OMOperatingUnitType::OMDepartment));
        sysTableLookup.parmQuery(query);
        sysTableLookup.parmUseLookupValue(False);
        sysTableLookup.performFormLookup();
    }

}

How to deploy non production database to Production server Dynamics 365 for finance and operation.

February 11, 2020 by alirazazaidi

This activity is not recommended, but most of the time,  before go live , master data is configured on UAT server and rapidly used. And most of functional consultant do not want this activity on production. Due to time saving as well as they are too much busy on different projects. Any how we can do this. There was no option available directly deploy or restore UAT database to production. For this we have to create service request to Microsoft. This is step by step guide.

So first step is to login into LCS and then open your project

From project detail form click on create new service

Machine generated alternative text:
365 for Operations Implementation Project 
5/31/2017 
and develop 
oroduction environment 
mock cutover 
system health 
7/15/2017 
Deploy 
3/25/2018 
Test 
5 
Operate 
Description 
The entire project team should pa 
te in a Go Live 
Health check ta ensure all asp 
f the system are 
operating as expected; bat 
ctionaly and technically. 
Task history 
ENVIRONMENTS 
Subscriptions available 
SeNice requests 
PRODUCTION 
Environment hsa state: Deployed 
Full details 
SANDBOX: STANDARD ACCEPTANCE TEST 
V Environment 
'at state: Deplcyed 
Full details 
SANDBOX: DEVELOP AND TEST 
V Environment 
dev state: Deployed 
Activate Wins-dws 
u etails

From Service request window. Go to service request and click on add new

Machine generated alternative text:
tecycle 
Services 
namvcs 
Operations Implementation Project 
.A Corporate 
m ces 
Work items 
Open work items 
Support issues 
Service requests 
Hotfix requests 
Extensibility support requests 
+ Add 
p Filter 
View environment details Reschedule Cancel 
Show cancelled requests 
Show finished requests 
onment name 
-uat 
Actionable by 
Sep.•ice Provider 
Provider 
Provider 
Downtime start 
1/4/2020 PM (UTC +04:00) 
10/9/2018 AM (UTC +04:00) 
10/3/2018 AM (UTC +04:00) 
Downtime end da 
144... 
63066 
61762 
Maintenance Operation 
New deployment 
New deployment 
New deployment 
Service request st... 
Requested 
Requested 
Requested

From popup select Sandbox to production

Machine generated alternative text:
ics 365 for Operations Implementation Project 
View environment details Reschedule Cancel 
Show cancelled requests 
Corporate Services LLC.) 
Show finished requests 
v"aintenance Operation 
Qew deployment 
Qew deployment 
Qew deployment 
Environment name 
Qui-I at 
Service request st... 
Requested 
Requested 
Requested 
Actionable by 
Provider 
Provide 
Pr 
Down 
10 
10 
Create request 
Select request type 
Production Point-in-time restore 
Restore the database of an environment with an 
automatic backup taken at an earlier date. 
Sandbox to production 
Move e copy of sandbox database into production for 
Go Live 
Other request 
Create other requests 
Cancel

Next window you have to select the time. Sandbox source and prefer down time.

At least 4 hours from the creation of service request and 5 hours minimum downtime required

Machine generated alternative text:
ished requests 
No 
Actionable by 
Provider 
Provider 
Provider 
Provider 
Provider 
Provider 
Provider 
Provider 
Request for sandbox to production 
Source environment name 
3-uat 
Target environment name 
hse 
Preferred downtime start date 
2/7/2020 9 v 
Preferred downtime end date 
2/8/2020 1 v 
All times are displayed in your 'ocel time zone (currently UTC 
Please be aware that other users will see the time localized 
into their time zones. 
Recommended! To produce a clean database refresh, we 
recommend performing this action when user activity and batch 
jobs are minimized in the source em.'lronment. 
I agree selecting a preferred downtime date and time does not 
I agree this request will result in a downtime of up to 4 hours wi 
I agree copying sandbox into production will OVERWRITE the pr 
Submit 
Cancel

Check all check boxes for agreed after that submit button will enabled .click on submit for Microsoft request.

They reserve downtime for 5 hours but 90 percent deployment will complete with in couple of hours.

How to get calling menu name in extensions Dynamics 365 for finance and operations

December 16, 2019 by alirazazaidi

Today is small tip, Many times, we have to took decision based on the name of menu  on which form is called. By getting menu name we can use same form for different purposes.  We can write logic based on current form called from which menu item.

Following is the code snippet helps you to achieve this.

[FormEventHandler(formStr(LogisticsContactInfoGrid), FormEventType::Initialized)]
    public static void LogisticsContactInfoGrid_OnInitialized(xFormRun sender, FormEventArgs e)
    {
        FormRun formRun = sender;
        
        if (formRun.args().menuItemName() == "CustomerLogisticsContactInfoGrid")
        {
            FormDataSource      LogisticsElectronicAddress_ds =formRun.dataSource("LogisticsElectronicAddress");
            LogisticsElectronicAddress_ds.InsertIfEmpty(true);
            LogisticsElectronicAddress_ds.object(fieldNum(LogisticsElectronicAddress, Locator)).mandatory(true);
        }

MB-300 global address book and other address books Dynamics 365 for finance and Operations

December 10, 2019 by alirazazaidi

We are here

What is Global Address Book

Global Address book is common or single repository in Dynamics 365 for finance and Operations. The basic idea is that, everything is Party either it is Person, Organization, Customer, Vendor, Employee, worker, competitor or Contact.

Data is associated with Party, That have, Address, phone number,  email.

It is possible that one Party is Customer in one legal entity and Vendor in other legal entity.  Change in any place reflect any places.

Party detail can be vary based on either party is organization or  person.

Customer, vend, Contacts, Employee, worker, Applicate all identified as Party Role

The link between Global Address book and all other object can be explained clearly by Microsoft documentation

Machine generated alternative text:
Address Book 
t: 
Perso 
Customer 
Prospect 
Worker 
user 
can belong to one or more 
Or anization 
is a type of 
Part 
plays a role of 
Vendor 
Competitor 
Applicant 
Contact 
c 
o 
o 
Can have one or more 
relates to 
o 
Location 
can have 
Quotation 
Sales Order 
Invoice 
Request for 
Quote 
Purchase 
Order 
More 
entities

Party Roles are considered to be as follow.

Customer is person or organization, who purchase goods or services from one or more legal entities.

Vendor is person or organization from organization purchase goods or services.

Contact. Is person that representor from vendor who communicate with organization.

Competitor– Person or organization, who provide the similar services or goods.

Applicant. A person, who applied to Job posted in your organization.

Points needs to consideration for Configure Global Address book

Points need to care before Configure Global Address book in your organization.

  • Sequence of First Name, Last Name and middle name in your organization.
  • Party record is delete automatically on deletion of Employee, worker, vendor or customer.
  • Notification in the case of Duplicate Party.
  • Should the Data Universal Numbering System (DUNS) number be included in a party record’s information?
  • If the DUNS number is included in a party record, should the uniqueness of the number be checked?
  • Party default, as organization or Person.
  • Role setup for private addresses.

Reference :

https://docs.microsoft.com/en-us/learn/modules/plan-config-global-address-book-finance-operations/

https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/organization-administration/overview-global-address-book

application cannot be started. Contact the application vendor – Workflow Dynamics 365 for finance and operations

August 17, 2019 by alirazazaidi

Hi all, today, while opening Workflow designer, I found following error

application cannot be started. Contact the application vendor

For this I have to clear the cache with following statement, in Command prompt

rundll32 dfshim CleanOnlineAppCache

If still problem remains, install click Once extension in Chrome.

Other wise use dynamics in Microsoft Edge. I tried on Microsoft Edge. It works perfectly fine.

Happy Daxing.

Change Text/BackGround Color Based Off Cell Value in Grid Dynamics 365 for finance and operations

July 15, 2019 by alirazazaidi

Hi all, today I got opportunity to change color of Grid Cell based on some condition.
I achieved this by following code snippet.
First all I set Auto declaration to true of  required control in grid,
Second I add overwrite displayOption of grid data source.
This code snippet is interesting. It triggers for every row on grid.
And if you see below code snippet method signature shows the Common _Record. With this common _record, we can get current row of data source. And this we can apply some condition
Suppose we what to customer Name background to red who has credit limit is less then 1000  Following works
  public void displayOption(Common _record, FormRowDisplayOption _options)
        {
            CustTable custTable = _record as CustTable;
            if ( custTable.CreditLimit  < 1000)
            {
                _options.affectedElementsByControl(CustName.id());
                _options.backColor(WinApi::RGB2int(255,0,0));
                _options.textColor(WinApi::RGB2int(255,255,255));
            }
            super(_record, _options);
        }
Happy DAXing.
No more MVP

The internal time zone version number stored in the database Dynamics 365 for finance and operations

May 28, 2019 by alirazazaidi

I  faced database Synch Error after deploying latest code to my Onebox VM.

 

The internal time zone version number stored in the database is higher than the version supported by the kernel (15/13). Use a newer Microsoft Dynamics 365 for Finance and Operations kernel

 

 

Solution is

Open local Database in SQL server management Studio

And run following Query on AXDB.

 

update SQLSystemVariables set VALUE = 7 where parm =’SYSTIMEZONESVERSION’

 

 

Reference:  http://dilliraj.blogspot.com/2016/07/the-internal-time-zone-version-number.html

 

« 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 (13)
  • 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