Tuesday, May 12, 2020

Get SQL name of Temp table Dynamics 365

Using code below in runnable class we can find temporary table name, which is created in SQL tempDB.


// Declare a TempDB table buffer
TmpCustName tCustName;
   
// Insert data to create the table in TempDB database in SQL
tCustName.AccountName = '10001';
tCustName.insert();
   
// Display the name

info(tCustName.getPhysicalTableName());


Dynamics 365 Trace parser does not work

While collecting and monitoring trace, we were getting error as below:

Error:
The ETW Providers  “Microsoft-AX-XPPExecutionTraces” and “Microsoft-Dynamics-AX-ExecutionTraces” aren't installed in the VM

Issue:
Below mentioned providers were not enabled.
Microsoft-Dynamics-AX-XppExecutionTraces : Used to capture X++ methods events.
Microsoft-Dynamics-AX-ExecutionTraces : Used to capture SQL events.

Solution:

Execute command below to enable both events.

$resourcefiledir = "C:\AOSService\webroot"
$inputmanfile = "C:\AOSService\webroot\Monitoring\DynamicsAXExecutionTraces.man"
$outputmanfile = "C:\AOSService\webroot\Monitoring\DynamicsAXExecutionTraces_copy.man"
$temp = Get-Content $inputmanfile
$temp = $temp -replace "%APPROOT%",$resourcefiledir
$temp | out-file $outputmanfile
wevtutil im $outputmanfile
$inputmanfile = "C:\AOSService\webroot\Monitoring\DynamicsAXXppExecutionTraces.man"
$outputmanfile = "C:\AOSService\webroot\Monitoring\DynamicsAXXppExecutionTraces_copy.man"
$temp = Get-Content $inputmanfile
$temp = $temp -replace "%APPROOT%",$resourcefiledir
$temp | out-file $outputmanfile
wevtutil im $outputmanfile

Friday, April 17, 2020

D365 FO you are not authorized to login with your current credentials.


Error:
You are not authorized to login with your current credentials. You will be redirected to the login page in a few seconds.

Reason:
Database restored into developer environment from another environment.

Solution:
Case 1:
If you have credentials of the user, who was the Admin in the environment from where database is restored - Use it!

Case 2:
If environment is locally hosted, we don't have credentials, we can use "Admin provisioning tool" to provision Admin user again. shortcut of this application is available in desktop otherwise you can find it from
Check K:\AosService\PackagesLocalDirectory\Bin


Case 3:
If the environment is Microsoft hosted, we will not be able to run “AdminUserProvisioning” tool and face error as below.

Here we have access of SQL database, so we can use query below to update Admin account.
Note: Value used in update query below, you can find from another database in your environment.   
UPDATE U
SET U.NETWORKALIAS = 'MThacker@abc.com',
    U.NETWORKDOMAIN = 'https://sts.windows.net/',
    U.SID = 'S-1-19-1410091826-xxxx-4079435192',
    IDENTITYPROVIDER = 'https://sts.windows.net/',
    OBJECTID = '25E55EE6-AB98-xxxxxxxx-FE00ACD05DBB'
--    Enable = 1
FROM UserInfo U WHERE U.Id LIKE 'Admin'

For case 3, after using query above, I was able to login to FO environment but still i am not sure this single query is enough?! 
Let me know, if you have any other experience with this! 



Monday, March 30, 2020

The working folder C:\Users\.. is already in use by the workspace MININT-F36S5EH;developer1@dynatechconsultancy.com on computer MININT-F36S5EH.

Error: The working folder C:\Users\.. is already in use by the workspace MININT-F36S5EH;developer1@dynatechconsultancy.com on computer MININT-F36S5EH.

Reason: we copied Virtual Machine and created new one. now we tried to map same workspace with different user. 
As server name and folder name is same TFS will not allow to map same folder on same server with different use (As it is logical that, on same server if another user wants to work, he/she needs to create another folder and map with that - TFS does not understand that we have copied VM so this is different server).

Solution: 
Option 1: (Rename developer server)
Rename server but as we know, as D365 FO developer it is not convenient and quick.if you want to go that way refer Microsoft blog - Link

Option 2: (Remove old account mapping)
I deleted my old account workspace by using command prompt.

Open CMD with admin rights, and navigate to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE



prepare command as below.
tf workspace /delete "WORKSPACENAME;PREVIOUSUSERACCOUNT”

copy and paste in the command prompt and hit enter, then select "Y".
tf workspace /delete "MININT-F36S5EH;rahulax@xyz.com"

Happening

Upgrade from AX 2012 to Latest Dynamics 365 Finance and Operation

Below are the steps defined by sequence. 1. Create new Upgrade project in Dynamics LCS. 2. Create VSTS Project and connect it with L...

Trending now