Blog Archives - Page 125 of 169 - - Page 125

Category Archives: Blog

Connecting D365 with Power BI Desktop

Introduction: This blog will help you through connecting power BI to your D365 environment. Steps: Open Power BI Desktop, click on Get data connection, and click on More… Go to Online Services > then select Dynamics 365 (Online) > then click on connect. It will ask you about Web API URL, this is not the CRM URL, it is the API URL that will allow you to communicate to you D365. You can locate the Web API in your Dynamics 365: Go to Dynamics365 > Go to Settings > Customizations. Select Developer resource inside Customizations. Inside the Developer Resource you can locate your Web API URL. Copy the Service Root URL and paste it in your Power BI Desktop. After adding the URL click on and click on the Organizational Account and click on Sign-in. After successful sign in, click on connect, you will see list of entities available for the login. Select the tables and get going, you are good to go now.

Share Story :

Fetch Parameter name from ID for SSRS Report in D365 Operations

Introduction: I was stuck in an issue recently where I was working on SSRS report with multiple filter parameters. In multiple parameter, one parameter was Brand ID and in report I had to display the Brand name instead of its ID. In this blog article, we will see how we can get the name of brand as parameter using brand id in Dynamics 365 Operations. Steps: Override getFromDialog() Method getBrandName() method to fetch Brand name. parmBrandName() to set the value 1. Override getFromDialog() Method: In UI Builder class override getFromDialog() method. This method gets the value of Brand Id. /// <summary> /// Transfers data from the dialog into the data contract object. /// </summary> public void getFromDialog() { super(); RecId r; r = contract.parmEcoResCategoryId(); if (r) contract.parmBrandName(this.getBrandName(r)); } 2. getBrandName() method to fetch Brand name: This method is used to find Brand name and called from getFromDialog() method. The return value is passed as parameter to contract class. /// <summary> /// This method looks up name of the organization using the hierarchy relationship id. /// </summary> /// <param name = “hierarchyRelationshipId”>The hierarchy relationship id for the organization.</param> /// <returns>Name of the organization.</returns> public EcoResCategoryName getBrandName(RecId hierarchyRelationshipId) { EcoResCategory category; select firstonly Name from category where Category.RecId == hierarchyRelationshipId; return category.Name; } 3. parmBrandName() to set the value: This method gets or sets the value of Category Name. /// <summary> /// Gets or sets the value of the datacontract parameter Category Name. /// </summary> /// <param name=”_categoryName”> /// The new value of the datacontract parameter CategoryName; optional. /// </param> /// <returns> /// The current value of datacontract parameter CategoryName /// </returns> [ DataMemberAttribute(‘Retail Category Name’), SysOperationLabelAttribute(literalstr(“Brands”)), SysOperationHelpTextAttribute(literalstr(“Brands Category”)) ] public EcoResCategoryName parmBrandName(EcoResCategoryName _categoryName = categoryName) { categoryName = _categoryName; return categoryName; } Conclusion: This blog showed how we can fetch the parameter value from another parameter in SSRS report using filter parameters with Contract and UIBuilder class in D365 Operations.

Share Story :

Open new form with fields pre-populated using Xrm.Navigation in D365

Introduction: Xrm.Navigation provides navigation related methods like openAlertDialog, openConfirmDialog, openErrorDialog, openFile etc. In this blog we will be discussing about openForm method which opens an entity form or a quick create form. There might be requirements to open a new form with certain fields pre-populated on certain conditions or to open a specific record. Implementation: Step 1: Syntax:Xrm.Navigation.openForm(entityFormOptions,formParameters).then(successCallback, errorCallback) Here the parameter entityFormOptions is an Object and is a required parameter. Step 2: In the below example taken, we have written a script on the contact form to trigger on Save which will open up the quick create form with values filled in some of the fields. As we can see in the below image we have passed the execution context as the first parameter. Step 3: The code for the same is given below: scripting={ myfunction:function(executionContext){ debugger; var formContext = executionContext.getFormContext(); var entityFormOptions = {}; entityFormOptions[“entityName”] = “contact”; entityFormOptions[“useQuickCreateForm”] = true; var formParameters = {}; formParameters[“firstname”] = formContext.getAttribute(“firstname”).getValue(); formParameters[“lastname”] = formContext.getAttribute(“lastname”).getValue(); formParameters[“fullname”] = formContext.getAttribute(“fullname”).getValue(); formParameters[“jobtitle”] = “Developer”; Xrm.Navigation.openForm(entityFormOptions, formParameters).then( function (success) { //Any Specific action to be performed console.log(success); }, function (error) { //Any specific action to be performed console.log(error); }); } }; Step 4 : After updating the value and saving the form a quick create form opens up with some of the fields filed out. We get the value of the fields using the formContext.getAttribute(“fieldname”).getValue(); The successCallback and errorCallback are optional. In the Unified Interface the successCallback and the errorCallback function will be executed only if the we are opening the quick create form. Step 5: As seen in the image below we make some changes to the contact form and save the changes. After saving a new contact quick create form opens up with the first name, last name and job title fields filled. Here in our case we have specified entityFormOptions[“useQuickCreateForm”] = true; If this property is not set a normal form open’s up with the values filled in the fields in the same window. If we want to open the new record in a new window we should specify entityFormOptions[“openInNewWindow”]= true which is a Boolean value and it is an optional field. Step 6: If we want to open a specific record we just specific the following entityFormOptions[“entityName”]=”account” entityFormOptions[“entityId”]=”Specify Guid Here” Hope this helped!

Share Story :

Deferral of Income & Expenses in Navision

Introduction: Microsoft Dynamics NAV allows you to set up deferrals of income and expenditure. These allow you to post transactions into a particular month but then spread the financial effect over a number of periods in a way you can specify. This article explains how to set up and use this functionality. Set up: First, you need to create a Deferral Template which will define how the deferral will work. To do this, type “deferral template” in the top right hand corner of the screen and open the Deferral Template list. You should see a screen like the following:- Either click on Edit to modify an existing template or New to create a new one.  You should then see the following screen:- Fill in the fields as follows:- Deferral Account – This is the GL Account code the deferral will initially be posted to.  This would normally be a Balance Sheet account; Deferral % – How much of the initial posting is to be deferred (can be from 1% to a maximum of 100%); Calc. Method – How the deferral will be calculated.  This can be one of:- Straight-Line, where an equal amount will be applied per period from the Starting to Ending Dates specified in the schedule; Equal per Period, where an equal amount will be deferred per period; Days per Period, where the amount deferred per period is based on the number of days in that period as a proportion of the total number of days in the whole deferral period; User-defined, where the amounts for each period are entered manually. Start Date – This can be one of:- Posting Date, the Posting Date of the document that generates the deferral; Beginning of Period, the beginning of the period in which the document is posted; End of Period, the end of the period in which the document is posted; Beginning of next period. No. of Periods – How many periods the deferral will be spread over. These are only default values, as we shall see later they can be amended on individual transactions if necessary. The next step is to assign the template to transactions. The simplest way to do this is to assign it to either a G/L Account, Resource or Item.  To assign it to a G/L Account, open the Chart of Accounts list, click on the account you wish to set the template for and click on the Edit button.  You should see the following screen:- On the Posting tab, set the Default Deferral Template as required. You can now start to use the Deferral functionality.  We will use a purchase order as an example.  Create a new purchase order and add a line for the G/L Account code you assigned the Default Deferral Code to.  Add a Quantity of 1 and a Direct Unit Cost. Use the Choose Columns functionality to make sure you can see the Deferral Code field.  By default, you should able to see the code as in the screen shot below. You can add, delete or change the code if you wish. To see the effect the posted deferral will have over time, drill down on the Line button below the Lines caption on the page and click on the Deferral Schedule option. The following screen should appear:- You can amend the deferral amount and dates and change the spread of the amounts over time if needed.  If you do make any changes, you may need to click on the Calculate Schedule button at the top of the page to recalculate the deferral amounts. Now receive and invoice the order. Note: You will need to set the Posting Date range on either your User Setup record or the General Ledger Setup date range to allow you post up to the last period the deferral will cover. If you do not, you will see an error message that a Posting Date is not within the allowed posting date range. Now bring up the Posted Purchase Invoice you created when you invoiced the order and click on the Navigate button.  If you view the G/L Entries for the invoice you should see something like the following:- As you can see, the cost has been posted to the deferrals g/l account rather than the account specified on the purchase order and the first month has then been reversed out and posted to the original account in accordance with the deferral schedule. Note that you cannot see the reversals of the deferral over the subsequent month of the schedule. To display these, remove the filter of the Posting date by clicking on the red x button immediately to the left of it.  You should now see the following screen:- Conclusion: As you can see, this shows the original entries and the entries that reverse out the deferral over the period of the deferral schedule. This Feature of Deferral is Available after NAV 2016 version only.

Share Story :

Creating a Control Add-in using Javascript and calling it in AL.

Introduction: In NAV 2017, control add-ins were called through .NET code which is imported as .ZIP files. With NAV 2018 .NET is not supported in extensions. Thus we’ve to perform the following steps to make a Control Add-in in Javascript. Pre-requisite: 1. NAV-2018 2. VS Code Procedure: Create a Startup script as start.js: Startup scripts are loaded whenever the NAV object containing the control add-in starts. Basically, the startup scripts are used for initialization. Create a Javascript file as demo.js : Contains most of the logic that the control add-in performs.  Create a control add-in object in AL: Control Add-in objects are used by NAV to register the control add-in and events and procedures on which the control add-in works. Create a NAV object using AL: This object generally contains the control add-in integrated into the standard, created or customized NAV objects. This object acts as the starting point where events are performed. Output: Added Control Add-In: Invoking on INIT: Script Invoking on Event: Conclusion: Thus, we can create control add-in using Javascript and access in NAV .AL objects using extensions

Share Story :

Setup multiple No. Series for a single field in NAV

Introduction: This blog shows how multiple number series are to be set up for a single field in NAV. The number series has to be setup dynamically on Assist-Edit of the page. Pre-requisite: NAV 2017 Demonstration: 1. Create a No. Series : Create a number series in the No.Series and then create a relationship. 2. Create a field in Sales & Receivable Setup which has relation No. Series Table: 3. On the Card Page Enable the AssistEdit property for that field. On the Assist Edit Trigger add a function call and Update the current page: This function checks whether the field No.Series is present in the Sales & Receivables Setup and then runs the No.Series via RUNMODAL using SelectSeries and selects the current series using SetSeries function. 4. Result: Conclusion: Thus, by this method, multiple customized No. Series can be added to a single field.

Share Story :

Error resolution to the error “You are not authorized to sign in. Verify that you are using valid credentials and that you have been setup as a user in Microsoft Dynamics NAV”

Introduction: When we restore the SQL database from one server to the other server and when we launch the Microsoft Dynamics NAV RTC, we the error “You are not authorized to sign in. Verify that you are using valid credentials and that you have been setup as a user in Microsoft Dynamics NAV”. This blog article gives the steps how to resolve this error. Pre-requisites: Microsoft Dynamics NAV SQL Server Management Service(SSMS) Reason for the error: When an SQL backup is restored from one server to the other, even the Windows users created in the previous server is restored to the new server which is not present. Hence, the error is thrown. Steps: 1. Open SSMS and select the database restored. 2. Click on new query and type in the below query. USE [Database Name] GO delete from [dbo].[User] delete from [dbo].[Access Control] delete from [dbo].[User Property] delete from [dbo].[Page Data Personalization] delete from [dbo].[User Default Style Sheet] delete from [dbo].[User Metadata] delete from [dbo].[User Personalization] 3. Enter the database name and click on execute. 4. Now restart the server instance and launch the Role Tailored Client(RTC) and make sure a windows user is made in  users in the RTC.

Share Story :

Commands to Create .bacpac file from Azure SQL to SQL Server

Introduction: This topic explains how to export a Microsoft Dynamics 365 for Finance and Operations, Enterprise edition database from an environment that is based on Microsoft Azure. Steps: 1. Create a duplicate of the source database. <“CREATE DATABASE MyNewCopy AS COPY OF axdb_mySourceDatabaseToCopy”> To monitor the progress of the copy operation, run the following query against the MASTER database in the same instance. 2. Run the Sql Server script to Prepare the database. –Prepare a database in SQL Azure for export to SQL Server. –Disable change tracking on tables where it is enabled. declare @SQL varchar(1000) set quoted_identifier off declare changeTrackingCursor CURSOR for select ‘ALTER TABLE ‘ + t.name + ‘ DISABLE CHANGE_TRACKING’ from sys.change_tracking_tables c, sys.tables t where t.object_id = c.object_id OPEN changeTrackingCursor FETCH changeTrackingCursor into @SQL WHILE @@Fetch_Status = 0 BEGIN exec(@SQL) FETCH changeTrackingCursor into @SQL END CLOSE changeTrackingCursor DEALLOCATE changeTrackingCursor –Disable change tracking on the database itself. ALTER DATABASE — SET THE NAME OF YOUR DATABASE BELOW MyNewCopy set CHANGE_TRACKING = OFF –Remove the database level users from the database –these will be recreated after importing in SQL Server. declare @userSQL varchar(1000) set quoted_identifier off declare userCursor CURSOR for select ‘DROP USER ‘ + name from sys.sysusers where issqlrole = 0 and hasdbaccess = 1 and name <> ‘dbo’ OPEN userCursor FETCH userCursor into @userSQL WHILE @@Fetch_Status = 0 BEGIN exec(@userSQL) FETCH userCursor into @userSQL END CLOSE userCursor DEALLOCATE userCursor –Delete the SYSSQLRESOURCESTATSVIEW view as it has an Azure-specific definition in it. –We will run db synch later to recreate the correct view for SQL Server. if(1=(select 1 from sys.views where name = ‘SYSSQLRESOURCESTATSVIEW’)) DROP VIEW SYSSQLRESOURCESTATSVIEW –Next, set system parameters ready for being a SQL Server Database. update sysglobalconfiguration set value = ‘SQLSERVER’ where name = ‘BACKENDDB’ update sysglobalconfiguration set value = 0 where name = ‘TEMPTABLEINAXDB’ –Clean up the batch server configuration, server sessions, and printers from the previous environment. TRUNCATE TABLE SYSSERVERCONFIG TRUNCATE TABLE SYSSERVERSESSIONS TRUNCATE TABLE SYSCORPNETPRINTERS –Remove records which could lead to accidentally sending an email externally. UPDATE SysEmailParameters SET SMTPRELAYSERVERNAME = ” GO UPDATE LogisticsElectronicAddress SET LOCATOR = ” WHERE Locator LIKE ‘%@%’ GO TRUNCATE TABLE PrintMgmtSettings TRUNCATE TABLE PrintMgmtDocInstance –Set any waiting, executing, ready, or canceling batches to withhold. UPDATE BatchJob SET STATUS = 0 WHERE STATUS IN (1,2,5,7) GO 3. Export the database from Azure SQL cd C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin SqlPackage.exe /a:export /ssn:.database.windows.net /sdn:MyNewCopy /tf:D:\Exportedbacpac\my.bacpac /p:CommandTimeout=1200 /p:VerifyFullTextDocumentTypesSupported=false /sp:EG=ajgU8!Fx=gY /su:sqladmin Where : ssn (source server name) – The name of the Azure SQL Database server to export from. sdn (source database name) – The name of the database to export. tf (target file) – The path and name of the file to export to. sp (source password) – The SQL password for the source SQL Server. su (source user) – The SQL user name for the source SQL Server. We recommend that you use the sqladmin  

Share Story :

Keeping tasks flexible in duration in Dynamics PSA

Overview: Auto Scheduling in PSA’s WBS books the hours when you enter the dates and dates when you enter the hours. They are interlocked. I want to schedule a task which is less in no. of hours but will span across more than expected duration of period. Such requirement is when signing a support contract with the client. Scenario While defining WBS for a Project called Abby’s D365 Implementation. I want to schedule a UAT task to span across over 10 which has only 22 hours. If I select the days as 3, I get my 22 Hours. Or select hours as 22, I get 3 days. But then, I can’t change the same to extend for more days. If I select the desired 10 days, I get 80 hours.Hence, I’ll toggle the Task Mode to Manual. Now, I can keep my Effort Hours and Duration as desired. To represent Manual mode, the icon changes to Calendar with a Pencil on it. That’s how you can keep flexible hours for the tasks you want to expand over a long duration.

Share Story :

Setting up User’s Manager in Office 365

Introduction: It is important that you have your organization hierarchy setup in order to use advance features. To setup Manager for User in Office 365, there’s a couple of ways how you can make that happen. Manager setup in Exchange Online. Manager setup in Azure AD. Manager setup in Exchange Online: 1. You need to login as administrator to your Office 365 and then choose ‘Admin Centers’, and ‘Exchange’. 2. Then go to ‘Recipients’ left menu item, search for the person that you want to manage, highlight the person and choose details. 3. Navigate down to Organization and then browse their manager. Manager Setup in Azure AD: Alternative is to set user’s manager in Azure Active Directory directly. To do that, you need to login as administrator to your Azure portal, Users and Group > All User. In order to set Manager in Azure AD, You will need to know manager’s person object ID to set it as a Manager ID for user (which you can look up by checking manager’s profile)’ Manager’s Profile – User’s Profile – After filling Manager ID and saving user profile, Manager will also be shown after few minutes in Mailboxes (Exchange Online). Manager setup can also be done in Dynamics 365, for doing so login to Dynamics 365. And, go to Settings > Users > Organization information and search for Manager of that user. Conclusion: In this way you can setup hierarchy in your Organization which is important in order to use full and advance features, you can also setup manager form Dynamics 365. Setting Manager information between Exchange Online and Azure AD will be synced.

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange