Tuesday, 10 December 2019

Add link/hyerlink through drillthrough on SSRS report in D365 F&O

Today I will discussing about one of the requirement which I came through while working on sales order confirmation report. 
The requirement was this that i need to add a hyperlink on Itemid field within existing sales order confirmation report. So here are couple of steps which any one can follow on in order to add a hyper link for itemid field within SSRS report.

Step 1) Open the design of your report. Right click on text box properties.
 






















Step 2) Go to action tab and click the URL radio button and add a expression then Click on ok button.


















Explanation of expression :
=Microsoft.Dynamics.Framework.Reports.BuiltInMethods.GenerateDrillThroughLink(
Parameters!AX_ReportContext.Value,
Parameters!AX_UserContext.Value,
"Menuitem name to be called",                    
"The type of the meun item which is to be called for instance : "Display"",
"Table name associated with Menu item or referred by it",
"Field name within the restricted table ",
"The value of field within dataset")

Output : 
When you will click on Item id field in SSRS report then it will navigate  you to release products form.


Wednesday, 8 May 2019

Get worker name against current user in D365 F&O

Today , I will be sharing a small code snippet which can be used to get worker which is attached with the current system user.

Here is the code snippet.

UserId currentUserId;
Name workerName;

currentUserId = curUserId();

if (currentUserId)
{
       workerName =  HcmWorker::findByPerson(DirPersonuser::find(currentUserId).PersonParty).name();

}

Note : curUserId() is system based method which can be used to get current user which is logged in right now.

Monday, 8 April 2019

Create batch job using SysOperationFramework

Today, I will discussing about how to create a batch job using SysOperationFramework in Dynamics 365 Finance And Operations.

Let's suppose we need  get all customer open transaction with negative amount whose payment method is null and update their fields on basis of some logic. Also, user will have option to select number of customers on run time.

In order to achieve our target we need create 3 new class.

1- Contract
2- Service
3- Controller

Step 1- Create a query in my case i have taken join between CustTrans and CustTransOpen tables and added ranges on AccountNum, AmountCur and PaymMode fields.





















Step 2- Create a new Contract class and add query in it.












Step 3- Create a new Service class and add method in it for executing the logic and get query from data contract. Execute query by using QueryRun. Add some logic in executeMode method as per your requirement like in my case I need to update some records.






















Step 4 - Create a new controller class.

























































Step - 5 Create a new action menu item and set the controller class name as object and set the
processing method name from service class in parameter field.












Step - 6 Final output of the batch job.



























Friday, 5 April 2019

Clear usage data in D365 Finance and Operations

Today I will be discussing about one of the common issue which you might have encountered at a time of executing batch job for second time.

For instance I was executing a job for first time and  have selected few parameter. At a code level I have set by default the value of batch job processing field to Yes.
However, before executing for second time I did modification in code and setting the batch processing field value to No . So now I was executing same batch job for second time but it batch processing field value was still Yes and due to this reason it was added in batch.

So, in order to reset or get latest code impact after build I need to reset usage data of that particular user.

Following are the steps required to reset usage data.

1- Open Chrome/IE browser.

2-  Click on setting in right most corner and select User options.













3- Click on Usage data button.




4-  Click on Reset button available in bottom. It will clear the usage data of specific or currently login user.


















That's it and your usage data will be reset :)

D365 F&O - Open table in a browser (IE/Chrome)

Today, I will be discussing about two different approaches which can be used for opening tables in chrome/IE in order to view data.

First approach

1 - Go to visual studio.
2-  Right click on the table.














Note : Default company for table browser will be picked from its user which is set as administrator.

Second approach

1- Go to IE or Chrome.
2- Paste the following URL

https://<URL>/?mi=SysTableBrowser&prt=initial&cmp=<Company>&tablename=<TableName>&limitednav=true

Sample : https://ABC.cloudax.dynamics.com/?mi=SysTableBrowser&prt=initial&cmp=USMF&tablename=BankStatementTable&limitednav=true

Cmp             : It is company whose data you want to view.
TableName  : The name of table whom you want to browse.
URL              : https://ABC.cloudax.dynamics.com



Thursday, 21 March 2019

Download cloud Dev VM's from LCS

Today, I will be discussing about how to download cloud Dev VM's from LCS.
Below are the few steps required to perform this task.

Note : You should have access to login on LCS and then access to project on which you need to work on.

Step 1) Login to LCS.

Step 2) Click on Project.
























Step 3) Click on three parallel lines and select cloud hosted environments option.

Step 4) Click on your cloud hosted environment and click on its full details option.





Step 5) Click on VM Name and it will download your VM.










Thursday, 7 March 2019

Few common functions related to Query and dates

Today, I will be discussing about few of the common methods related to query and dates.

Let's begin with it.

Date  related methods 

 -  Year(date  _date) : Method will be used to get year from specified date.
-   mkdate(int _day, int _month, int _year) : Method will be used to make and return a new date
-   mthOfYr(date _date) : Method will be used to get month from the the specified date parameter.
-   dayOfMth(date _date) : Method will be used to get day of the month from the specified date parameter.


Query  related methods 

QueryBuildRange         startAndEndDateRange ;

startAndEndDateRange = this.query().dataSourceTable(tableNum(EmplSickLeaveEncashment)).addRange(FieldNum(EmplSickLeaveEncashment, NextEncashDate));
startAndEndDateRange.value(SysQueryRangeUtil::dateRange(startDate,toDate));
startAndEndDateRange.status(RangeStatus::Hidden);

Here for adding date range we can using dateRange method from SysQueryRangeUtil class.
In order to hide range we can set its status to Hidden by using method of status.


Custom Business events Part 3 - (Activate custom business event) in D365 F&O

 In this blog we will discuss about the steps to activate a custom business in D365 F&O. As we know that business event catalog does not...