Posts

Power BI Report in Dynamics 365

Image
In Dynamics 365, We can develop Power BI reports using the "ODATA" entity model. In doing so, we can see "cross-company" data in which we can apply the filters at run time without any refresh or loading time. Steps to develop power BI Report includes the following Visual Studio Steps: 1. Make the Query from which data needs to be pulled. 2. Assign that query to AX View . 3. Create a Data Entity and assign the view in the data source of entity. 4. Create a unique Index in the entity 5. Generate the Staging Table by right clicking on data entity then click on generate staging table. 6. Create the Security Privileges for entity. 7. Build the project. Figure 1: Visual Studio Objects Power BI Desktop Steps: 1. Open Power BI Desktop. 2. Select the "Get Data" from power BI Desktop 3. Select "More..." as shown in figure 2 Figure 2: Power BI Get Data Tab 4. In the "Online Services" , select "Dynamics...

Bulk Insertion with null values in tables - Dynamics 365

Image
I nsert_recordset does not accept null values in the selection fields. Error:   Cannot insert multiple records. The SQL database has issued an error. Cannot insert the value NULL into column ‘ ‘, table ‘ ‘; column does not allow nulls. INSERT fails. There are some work around which you can do to overcome this problem. Method 1: This method uses two database calls You can simply insert all the fields which contains non-null values in the table then update the records in the table using update_recordset. This method will perform two database calls first one for insert and then update. // method for inserting and updating data into test table with insert recordset and update recordset  private void  insertUpdateDatainTestTable()     {          Testtable  table;         BOM bom;          Query  query                ...

Bulk Insertion from AOT query - Dynamics 365

I n Dynamics 365, we can use a static method to insert the record directly into the table, make sure that this method requires all the selection fields contains a non-null values otherwise this method will give you an error. Here is a quick review on how to achieve this without any loops. The query contains two data sources using inner join " InventTable " and " CustTable ". insert_recordset method requires three arguments. 1. Table buffer in which data needs to be inserted. 2. Map of fields and container for fields and values in that fields 3. Query from which data needs to be pulled. // method for inserting data into test table with insert recordset  private void insertDataintoTestTable()     {         Testtable table;         Query query                       = new Query ( queryStr ( TestQuery ));         QueryBuildDataSource ...