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.


Monday 4 March 2019

Table browser - You are not authorized to login with your current credentials error in D365 F&O

Today, I will discussing about one of the common issue which you might have faced while opening table browser in D365 finance and operations. Eventhough you are logged in successfully as administrator and have full rights.

The error will be :
You are not authorized to login with your current credentials.





A quick work around for it.
Go to on following path : C:\AOSService\PackagesLocalDirectory\Bin
Here you will find a file DynamicsDevConfig.xml










Open this file as administrator in notepad. Here at the end you will find following line of code
<OfflineAuthenticationAdminEmail>test@domain.com</OfflineAuthenticationAdminEmail>

The email id which is associated with it is not authorized so replace it with your authorized email address and you will be able to access it.

Join multiples tables with same table using query build data source

Today, I will be discussing about one of the common issue related to query creation using  query build data source. 

Let's suppose we have following tables.
 - Leave Assignment  table - (Base Table) - Namely Parent for demo purpose
 - HcmEmployment table   - Namely Child 1 for demo purpose
 - Leave Plan table    - Namely Child 1 for demo purpose

We want to link base table with both hcm employment (child1) and leave plan table (child2)  using query build data source. Below is the code used for performing this operation.

public QueryRun   fetchMultipleTableQueryDemo()
{
    QueryBuildDataSource hcmEmploymentds;
    QueryBuildDataSource qbds;
    Query query = new Query();
       
    // Adding parent  as a datasource
    QueryBuildDataSource qbds = query.addDataSource(tableNum(Parent));

    // Adding child 1 as a datasource
    hcmEmploymentds= qbds.addDataSource(tableNum(Child1));
    hcmEmploymentds.joinMode(JoinMode::InnerJoin);
    hcmEmploymentds.addLink(fieldNum(Parent, Worker),fieldNum(Child1, Worker));
    hcmEmploymentds.fetchMode(QueryFetchMode::One2One);

   // Adding child 2 as a datasource
   qbds = qbds.addDataSource(tableNum(Child2));
   qbds.joinMode(JoinMode::InnerJoin);
   qbds.addLink(fieldNum(Parent, LeaveDetail), fieldNum(Child1, RecId));
   qbds.fetchmode(QueryFetchMode::One2One);
       
    return new QueryRun(query);
}

Connect and upload in azure blob with azure key vault using x++

 Today, I will be sharing details about file upload in azure blob using azure vault that includes pre requisite and code snippet used to it....