Category Archives: D365 Finance and Operations
Modifying a report query based on the input data in AX 2012R3
Introduction: Controller class is used to control the report execution as well as pre processing of the report data. The SSRS reporting framework uses this class to modify the report dialog, calling the SQL Server reporting services, as well pre processing parameters for the report. How to do? Create a new class. Open AOT –> Classes Open the class declaration and select on View Code Now write the following code: class SSRSDemoController extends SrsReportRunController { } Create a new method and write the following code: public static client void main(Args args) { //define the new object for controller class SSRSDemoController ssrsDemoController; ssrsDemoController = new SSRSDemoController(); //pass the caller args to the controller ssrsDemoController.parmArgs(args); //set the report name and report design to run ssrsDemoController.parmReportName(ssrsReportStr(SSRSSessionQuery,Design)); //execute the report ssrsDemoController.startOperation(); } Conclusion: Reports that are opened from a form – Controller class is also used when reports are opened fro a form and are needed to show selected records details. Use preRunModifyContract method to achieve this.
Share Story :
Reading more then 10K records in D3FOE OData API
Introduction: We all know Dynamics 365 Finance and Operations has limitation of 10K records to be fetched at a time using Data Entity. While reading records from D3FOE for CRUD operations in OData API you will face issue if you want to process more than 10K records at a time. You can resolve this issue by using query parameter ‘skip’ and ‘top’. Use the below syntax to query records while reading from D3FOE: DataServiceQuery<[EntityName]> EntityObject = context.[EntityName].AddQueryOption(“$skip”, 10000).AddQueryOption(“$top”, 10000); where, EntityName = Name of data entity from where you want to read records Skip = it will skip the number of records you specified from the fetched records Top = It will select the number of records specified after skipping the records Example: If there are 30K records in CustCustomers then above line will skip 10K records and then pick the next top 10K records. So records selected will be from 10001 to 20000. DataServiceQuery<CustCustomers> EntityObject= context.[CustCustomers].AddQueryOption(“$skip”, 10000).AddQueryOption(“$top”, 10000); You can also get the total count of records and then run a loop until max count of records and increment the skip with 10K on each loop and top with 10K. Using this you can read ‘n’ number of records.
Share Story :
Creating Custom Fields
Introduction: This blog articles explains the ability to add custom fields is available in platform update 13 and later. Creating Custom Fields: Process for creating a custom field and placing that field on a form: Navigate to the form where the new field is needed. Click on Options and then Personalize this form Click Insert and then Field Select the region of the form where you want to expose the new field. After selection, the Insert fields dialog box will display a list of existing fields that can be inserted into the selected region of the form. Click the Create new field button above the list to initiate the process of creating a custom field. This will open the Create new field dialog box. Enter all the relevant details for the new field Click save and insert the new field Note that there is currently a limit of 20 custom fields per table.
Share Story :
User based Personalized Workspace from UI in D365 Operations
Introduction: In D365 Finance and Operations, there are various modules and each contains many forms. Users working in Operations uses forms from different modules and sometimes it becomes difficult to navigate or remember the path of all forms. It is also time consuming. A good solution for this is creating a Personalized Workspace and adding all the required items in it. Everyone know this can be done from code using forms. Another simple way is to create a Workspace directly from UI and it will be only available to the user who created it. In this blog, I will show you how to create workspace specific to users from UI. Steps: Create Workspace Rename Workspace Add elements to workspace Create Workspace: Go to D365 Operations Default Dashboard page. Right click anywhere on the Dashboard -> Select Personalize In the Dialog Select an option ‘Add a workspace’. This will add a new Workspace at the end of page Rename Workspace: Right Click the Workspace -> Click Personalize: My Workspace 1 Enter a Name in the textbox Add elements to workspace: Go to form you frequently use to add on Workspace. In this case I will add All customers to my workspace. Accounts Receivable -> Customers -> All Customers In Action Pane, go to Options Tab -> Personalize, select Add to Workspace. In Workspace dropdown, add name of newly created workspace. In Presentation dropdown, select the format in which you want to display the form Tiles- It is a summary view. List- It is a Tabbed format. It can be horizontal or vertical. Link- It will simply display a link taking you to the form. Conclusion: This is how we can create a personalized workspace which will be limited to respective user. We can also personalize the workspace using controls residing in personalize option.I will provide more details on this in my next blog.
Share Story :
Store Coupon Code in Dynamics 365 Finance and Operations
Introduction: In this blog we will see how to apply coupon discount on MPOS (Store) in Dynamics 365 for Finance and Operations. Steps: Step 1: Create Bar code Mask Character for Coupon Code. Step 2: Create a New Barcode Mask set up. Keep the type as Coupon. Step 3: Create Bar Code for Coupon. Assign the Mask ID which was created in step 2. Step 4: Create Number Sequence for Coupon Code ID and Coupon Number. Step 5: Set the Retail Parameters for Coupon. Assign the Mask ID that was created. Step 6: Create a New Discount. Mention the discount Price, Products in Lines, Price group, Valid Discount Account and enable coupon code required. Step 7: Create a new Coupon. Mention the usage limit, usage type, associate discount to the coupon, Create a new line for coupon. Activate the Coupon. The Bar code will be generated. Make a note of the Bar code. This is how you set up Coupon Code on Stores in Dynamics 365 for Finance and Operations. Run Jobs and flow the discount to the store. To Redeem the Store Coupon Code: Step1: Scan the product that is under Discount. Step2: Scan the Barcode or Manually inter the Barcode. Step 3: The discount will be applied to the product along with the discount name Step4: Make Payment.
Share Story :
Commands to Import .bacpac file to D3FOE SQL Server
Introduction: This blog article will explain how to import a .bacpac file to Microsoft SQL Server which is created from Finance and Operations database that is based on Azure SQL Server. You can refer steps here for creating .bacpac file. Following points are recommended for smooth and secure importing of .bacpac file Take a backup of existing database so you can revert if required. Import the database with a new name and modify it later once the entire process is completed error free. Copy the .bacpac file to local computer where you want to import the database for better performance. Steps: Run command prompt as an administrator. Run the below command to Import the database. cd C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin SqlPackage.exe /a:import /sf:D:\Exportedbacpac\SSProd.bacpac /tsn:localhost /tdn:SSProd /p:CommandTimeout=1200 where, tsn (target server name) – The name of the SQL Server to import into. tdn (target database name) – The name of the database to import into. The database should not already exist. sf (source file) – The path and name of the file to import from. Update the database: Run the following script against your database to add the users you deleted while creating .bacpac file. Update your database name in Alter Command. CREATE USER axdeployuser FROM LOGIN axdeployuser EXEC sp_addrolemember ‘db_owner’, ‘axdeployuser’ CREATE USER axdbadmin FROM LOGIN axdbadmin EXEC sp_addrolemember ‘db_owner’, ‘axdbadmin’ CREATE USER axmrruntimeuser FROM LOGIN axmrruntimeuser EXEC sp_addrolemember ‘db_datareader’, ‘axmrruntimeuser’ EXEC sp_addrolemember ‘db_datawriter’, ‘axmrruntimeuser’ CREATE USER axretaildatasyncuser FROM LOGIN axretaildatasyncuser EXEC sp_addrolemember ‘DataSyncUsersRole’, ‘axretaildatasyncuser’ CREATE USER axretailruntimeuser FROM LOGIN axretailruntimeuser EXEC sp_addrolemember ‘UsersRole’, ‘axretailruntimeuser’ EXEC sp_addrolemember ‘ReportUsersRole’, ‘axretailruntimeuser’ CREATE USER axdeployextuser WITH PASSWORD = ‘<password from LCS>’ EXEC sp_addrolemember ‘DeployExtensibilityRole’, ‘axdeployextuser’ CREATE USER [NT AUTHORITY\NETWORK SERVICE] FROM LOGIN [NT AUTHORITY\NETWORK SERVICE] EXEC sp_addrolemember ‘db_owner’, ‘NT AUTHORITY\NETWORK SERVICE’ UPDATE T1 SET T1.storageproviderid = 0 , T1.accessinformation = ” , T1.modifiedby = ‘Admin’ , T1.modifieddatetime = getdate() FROM docuvalue T1 WHERE T1.storageproviderid = 1 –Azure storage ALTER DATABASE [<your AX database name>] SET CHANGE_TRACKING = ON (CHANGE_RETENTION = 6 DAYS, AUTO_CLEANUP = ON) GO — Begin Refresh Retail FullText Catalogs DECLARE @RFTXNAME NVARCHAR(MAX); DECLARE @RFTXSQL NVARCHAR(MAX); DECLARE retail_ftx CURSOR FOR SELECT OBJECT_SCHEMA_NAME(object_id) + ‘.’ + OBJECT_NAME(object_id) fullname FROM SYS.FULLTEXT_INDEXES WHERE FULLTEXT_CATALOG_ID = (SELECT TOP 1 FULLTEXT_CATALOG_ID FROM SYS.FULLTEXT_CATALOGS WHERE NAME = ‘COMMERCEFULLTEXTCATALOG’); OPEN retail_ftx; FETCH NEXT FROM retail_ftx INTO @RFTXNAME; BEGIN TRY WHILE @@FETCH_STATUS = 0 BEGIN PRINT ‘Refreshing Full Text Index ‘ + @RFTXNAME; EXEC SP_FULLTEXT_TABLE @RFTXNAME, ‘activate’; SET @RFTXSQL = ‘ALTER FULLTEXT INDEX ON ‘ + @RFTXNAME + ‘ START FULL POPULATION’; EXEC SP_EXECUTESQL @RFTXSQL; FETCH NEXT FROM retail_ftx INTO @RFTXNAME; END END TRY BEGIN CATCH PRINT error_message() END CATCH CLOSE retail_ftx; DEALLOCATE retail_ftx; — End Refresh Retail FullText Catalogs Run the re-provision tool: To ensure Retail components are functional run the re-provision tool. Find steps here on how to run the tool. Start using the new database: Stop the below service to switch the database. World wide web publishing service. Finance and Operations Batch Management Service. Management Reporter 2012 Process Service. Once the services are stopped, rename your original database to ‘AxDB_orig’ and the new database to ‘AxDB’. Restart the service. Conclusion: This is how you can create a new database and import the data from a .bacpac file. If you face any issue then you can switch to original database or restore the copy of original database created prior to import.
Share Story :
Change Tracking for Data Entities in D365 Operations
Introduction: In this blog article, we will see how we can track changes in data made since last export using Data Entities in D365 Operations. It is basically an SQL Change Tracking feature. Steps: Go to Data Management -> Data Entities. Select the Entity for which you want to enable Change Tracking. In the Action Pane, go to Change Tracking. There are 3 options: Enable primary table – It will only track changes made on root table. Enable entire entity – It will enable tracking for all Writable Datasource used in the entities. Enable custom Query – You can create a custom query to track changes on the required tables. You can also disable the change Tracking by clicking on ‘Disable Change Tracking’ option. You should be careful while enabling change tracking as it will require additional processing for maintaining data for changed records.
Share Story :
Pin Embedded Power BI Reports to Workspace in Dynamics 365 for Finance and Operations
Introduction: In this blog article, we shall see how to pin the power BI reports to Workspace. How to pin? Power BI reports can be added to any workspace that contains a Links section. Once the Power BI reports have been deployed successfully you can pin them to your Dynamics 365 Finance and Operations Workspace. Steps: Open a workspace in Dynamics 365 For Finance and Operations In the workspace, click the Options tab Click Open Report Catelog The list of reports comes from the reports that you have in your Power BI account Click on Ok and those reports will be on your workspace Similarly any customized or out of the box reports can be pinned to your workspace.
Share Story :
Fetch Hierarchical data for Product Category in Dynamics 365 Operations
For today’s modern day business that needs customer satisfaction, scalability and digital intelligence, dynamics 365 finance and operations is a complete ERP solution and is one of the most trusted software in the world without any doubt. This ERP solution helps you to innovate your products and processes so that client’s expectations can be met on time and your business can survive well in the cut-throat competition. It also gives visibility to your business across customer sales and service, marketing system and connected distribution. It simplifies production floor management, speeds up product introduction and offers flexibility in delivery alternatives. When it comes to the impact on your finance, you can gain immediate financial insights, drive corporate strategy and growth and through efficient collection management, decrease debts considerably. Introduction: In this blog article, we will see how we can fetch hierarchical data using X++. How to fetch? We will take a scenario where we will pass a category hierarchy and will fetch all categories of that hierarchy and its child category. public class ProductCategoryHierarchy { EcoResCategory category; public void ParentCategory() { while select category where category.CategoryHierarchy == “Brands” { //code this.getChildrenCategory(category.RecId); } } /// <summary> /// get categories of child product /// </summary> public void getChildrenCategory(EcoResCategoryId ParentCategory) { while select category where category.ParentCategory == ParentCategory { //code this.getChildrenCategory(category.RecId); } } }
Share Story :
Creating Entity Store in Dynamics 365 For Finance and Operations
Introduction: In this blog article, we will learn how to create entity Store in Dynamics 365 For Finance and Operations. Steps: 1. Add new Items 2. Under Dynamics 365 items –> Analytics –>Aggregate Measure. 3. Assign a table to the aggregate measure. 4. Add Measures to the aggregate Measure . Mention the field and Set appropriate properties of the measure. 5. Create a new dimension. 6. Assign a table or view to your Dimension. 7. Now from the solution explorer drag the newly created dimension to the aggregate measurement. The aggregate dimension will have system generated dimensions already present by default. Select the dimensional field and make appropriate relations. Save the Project. Clean and rebuild the project. Synchronize the database . This entity store will be available under entity store in Dynamics 365 for Finance and Operations.