link to run a class from front end through sysclassrunner
dynamics url/?mi=SysClassRunner&cls=classname
link to run a class from front end through sysclassrunner
dynamics url/?mi=SysClassRunner&cls=classname
Scenario:- When you need to get amount with required exchange rate.
Case :- It also depends on whether we are going with Account currency exchange rate or Budget exchange rate type as shown in image below
Case 1:- If it is Budget exchange
Code:-
CurrencyCode currencyCode = SystemParameters::find().SystemCurrencyCode;
str fromcurrency='USD';
str tocurrency='CAD';
real amount=120;
CurrencyExchangeHelper currencyExchangeHelper;
currencyExchangeHelper = currencyExchangeHelper::construct();
currencyExchangeHelper.parmLedgerRecId(Ledger::current());
currencyExchangeHelper.parmExchangeRateTypeRecId(Ledger::budgetExchangeRateType());
Info(strFmt("%1",currencyExchangeHelper.calculateCurrencyToCurrency(fromcurrency, tocurrency,amount, true)));
Case 2:- If it is Account currency exchange rate
Code:-
CurrencyCode currencyCode = SystemParameters::find().SystemCurrencyCode;
str fromcurrency='USD';
str tocurrency='CAD';
real amount=120;
CurrencyExchangeHelper currencyExchangeHelper;
currencyExchangeHelper = currencyExchangeHelper::construct();
currencyExchangeHelper.parmLedgerRecId(Ledger::current());
currencyExchangeHelper.parmExchangeRateTypeRecId(Ledger::defaultExchangeRateType());
Info(strFmt("%1",currencyExchangeHelper.calculateCurrencyToCurrency(fromcurrency, tocurrency,amount, true)));
scenario :- Generally in Dynamics there are some workflows with globally and some are Legal entity specific . With association type as shown in below
Step 1:- To make a workflow global or Legal entity specific. Go to visual studio >
find the workflow type and click on properties and in Association type choose the type you need as shown in below
Note :- Don't change this for standard workflows. And can use this for Custom mostly.
Step 1:- Get Backpac file to your dev machine
Step2:- move this file to location as shown in below

Step 2 :- Navigate to Download and Install SqlPackage - SQL Server | Microsoft Learn
and scroll down for windows package as shown in below
download the file and extract the zip file
Step 3:- open the file and copy location as shown in below
Step 4:-Open commnd promt with run of administrator and run cd paste the location copied from above as shown in below
Step5:-run this command SqlPackage.exe /a:import /sf:J:\MSSQL_BACKUP\uatbackup.bacpac /tsn:localhost /tdn:AXDB_New /TargetTrustServerCertificate:True /p:CommandTimeout=1500
Step 6:-Wait for 6 hours until you see DB restored sucessfully.
Step 7:-Go to SSMS >Database >AXDB>properites>makes multiuser to single user
then Rename to AXDB_OLD
Step 8:-Rename AXDB_New (new db restored) to AXDB
Make AXDB_OLD properties to single user
Step 9:-Restart all services. Now Dev machines runs with Tier 2 database
Note:- This process is when you have been given with bacpac file (usually when we export tier 2 it will be bacpac only.most of the time we get bacpac file only).
If we get bac file we can directly restore with in few steps and lesstime in ssms itself without cmd promt.
Thank you!!
Today in this blog we learn about how to see relations between tables in pictorial representation.
Step1:- Navigate to Github https://github.com/noakesey/d365fo-entity-schema and click on releases as shown in below
Step2:- Down the first DLL file as shown in below
Step3:-Once you have downloaded the file it will shown in warning file click on three dots >Keep>Keep anyway as shown in below
Step4:-Click on the properties of the file and click on unblock and apply as shown in below
Step5:-Copy the file and place in folder
Navigation:-
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\jalba1yr.dr0\AddinExtensions
If jalbalyr.dr0 folder not available then paste folder in C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions
Step6:-Go to any table>rightclik>Addins>Generate entity relation schema as shown in below
Step7:-Click on outward and inward >DBML as shown in below
Step8:-Copy the whole code and click on the link as shown in below
Step9:-then click on create diagram as shown in below
Step10:-Clear existing code in left pane and paste the code copied in VS as shown in below
Thank you!!
Scenario:- We can do some actions in workflow through code
1) Submit:-
Code:-
WorkflowTypeName workflowTypeName = workflowTypeStr(CustomWorkflowType);
Workflow::activateFromWorkflowType(workflowTypeName, Table.RecId, workflowComment, NoYes::No);
2) Approve:-
Code:-
WorkflowWorkItemTable workflowWorkItemTable;
WorkflowTypeName workflowTypeName = workflowTypeStr(CustomWorkflowType);
select firstonly workflowWorkItemTable
where workflowWorkItemTable.Type == WorkflowWorkItemType::WorkItem
&& workflowWorkItemTable.Status == WorkflowWorkItemStatus::Pending
&& workflowWorkItemTable.RefTableId== tableNum(EmployeeTable)
&& workflowWorkItemTable.RefRecId == 5637144576;
if(workflowWorkItemTable)
{
WorkflowWorkItemActionManager::dispatchWorkItemAction(workflowWorkItemTable,"Auto Approve by system",curUserId(), WorkflowWorkItemActionType::Complete,menuitemDisplayStr(Employee));
}
3) cancel or recall :-
Code:-
WorkflowWorkItemTable workflowWorkItemTable;
WorkflowTypeName workflowTypeName = workflowTypeStr(CustomWorkflowType);
select firstonly workflowWorkItemTable
where workflowWorkItemTable.Type == WorkflowWorkItemType::WorkItem
&& workflowWorkItemTable.Status == WorkflowWorkItemStatus::Pending
&& workflowWorkItemTable.RefTableId== tableNum(EmployeeTable)
&& workflowWorkItemTable.RefRecId == 5637146826;
if(workflowWorkItemTable)
{
Workflow::cancelWorkflow(workflowWorkItemTable.CorrelationId, "cancel by code");
}
4) Resume:-
Code:-
Workflowtrackingstatustable workflowTrackingStatusTable;
select * from workflowTrackingStatusTable where workflowTrackingStatusTable.CONTEXTRECID == 5637147576
&& workflowTrackingStatusTable.CONTEXTTABLEID == tableNum(EmployeeTable);
if(workflowTrackingStatusTable)
{
Workflow::resumeWorkflow(workflowTrackingStatusTable.CorrelationId, "resume by code");
}
Thankyou!!
link to run a class from front end through sysclassrunner dynamics url/?mi=SysClassRunner&cls=classname