Category Archives: Dynamics 365
Raise and expense entry for a Fixed Bid Project in D365 PSA
Introduction: Let’s consider a scenario where we need to raise an expense entry for a Fixed Bid project. PSA by definition does not charge for expenses. If you want to have fixed price for the project and expense to be charged for other things, you need to do it via adjusting the contract. Steps: Follow the steps below to prepare the contract: Prepare a contract and add a Fixed Bid project with “Time” and “Fee” as the option shown below: Add another line and create another Time and Material Type project and select “Expenses” as the option. You will have to inform the team to select the right project while raising the expense, that is the T&M one. Now when you create the invoice via that contract, you will get your milestone as well as the expenses coming up in the same invoice as shown below.
Share Story :
Session Time out in Dynamics 365
Introduction: By default, Dynamics 365 online sets user time out 24 hours. In that case a user not required to login in up to 24 hours regardless or active or inactive. Applicable for- Applies to Dynamics 365 (online), version 9.0 Microsoft Dynamics CRM 2016 (on-premises, version 8.2) Microsoft Dynamics CRM 2016 (on-premises, version 8.1) User session timeout: Earlier there was no configuration provided to set the session timeout. Dynamics 365 with specified version have provision to set the session timeout. To enforce the users to re-authenticate after pre-defined time, this can be set by admin. Once the specified time is passes the user will logoff automatically from the system. Configure session timeout: To configure the session timeout, you need to follow the below path and set the time Dynamics 365 -> settings -> Administrator -> System Settings -> General tab By default, it is set to 1440 minutes and maximum value as well. If you want to set session time out as per you convince then you need to select the option “Set Custom” and specify the desire value. You can also specify time for warning message before the session timeouts. Inactivity timeout: By any reason a user forgot to logoff from his system then if Dynamics 365 detects the ideal mode then it will logoff the user automatically after certain period. Configure inactivity timeout: To configure the session inactivity timeout, you need to follow below path and set time Dynamics 365 -> settings -> Administrator -> System Settings -> General tab By default, “session timeout” is inactive and not enabled. If you want to configure inactive timeout, you need to enable it from general tab as shown below point no 6. Session timeout section: Minimum duration for inactivity is 5 minutes and maximum duration of inactivity is 1440. Conclusion: It is good practice to have session timeout and inactive timeout, which will provide security to data.
Share Story :
Retrieve Multiple Records using Web API in Dynamics 365 version 9.0
Introduction: In this blog article, we will be showing how use fetch XML to retrieve multiple records with the new Web API in Dynamics 365 version 9.0 Implementation: Step 1: The retrieveMultipleRecords() method retrieves a collection of entity records. The basic syntax is as follows: Xrm.WebApi.retrieveMultipleRecords(entityLogicalName,options,maxPageSize).then(successCallback, errorCallback); Here the options parameter refers to the query that will decide the data which has to be retrieved from the system. We will be using the fetchXml attribute to specify a FetchXML query to retrieve contacts of a specific account. The maxPageSize indicates number of records to be returned per page. If this is not specified the default value is 5000. In this example we have not specified the maxPageSize. Step 2: First we write the code and upload it as a JavaScript web resource. Code var scripting = { retrieveMultipleContacts(executioncontext) { debugger; var formContext = executioncontext.getFormContext(); var accountId = formContext.data.entity.getId(); var fetchXml = “<fetch version=’1.0′ output-format=’xml-platform’ mapping=’logical’ distinct=’false’><entity name=’contact’ ><attribute name=’fullname’ /><attribute name=’telephone1′ /><attribute name=’contactid’ /><order attribute=’fullname’ descending=’false’ /><filter type=’and’><condition attribute=’parentcustomerid’ operator=’eq’ uitype=’account’ value ='” + accountId + “‘ /></filter></entity ></fetch > “; Xrm.WebApi.retrieveMultipleRecords(“contact”, “fetchXml= ” + fetchXml).then( function success(result) { for (var i = 0; i < result.entities.length; i++) { console.log(result.entities[i]); } }, function (error) { console.log(error.message); } ); } }; Here we take the execution context as the input parameter and we get the form context using the getFormContext() method. This method returns a reference to the form or an item on the form. Using the formContext we get get the account id which is used to fetch the contacts of that specific account. Step 3: On the account form, in the form properties we set the Event to OnSave as shown below. Step 4: In the handler properties we set the function name, in our case it is scripting.retrieveMultipleContacts. And it is important to check the “Pass execution context as the first parameter” checkbox as shown below. Step 5: We see that the account A. Datum Corporation (sample) has two contacts. Step 6: The script runs when the form is saved and while debugging we can see in the console, two contacts are returned in the results. We get the the attributes that were present in the FetchXML query. Hope this article was helpful!
Share Story :
Dynamics CRM Marketing list members sync with MailChimp- Part 2
Introduction: This blog is the continuation of Part 1 and it will show you the code that are required for the action to work and the workflows created in CRM. Steps: 1. Add a button on marketing list using Ribbon Workbench and script which calls the action. 2. Create an action “MailChimpBatchCreateCall” that triggers on Sync button click. When the button is clicked, action is called using JavaScript. This action Retrieves configuration and Marketing list records from CRM and add the members to Mail Chimp Marketing list by Mail Chimp API Call (Batch request). The code to be included in the action is given below: This is a POST request as we are creating list members in MainChimp using (WebClientEx client = new WebClientEx()) { string authorizationKey = string.Empty; authorizationKey = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(string.Format(CultureInfo.InvariantCulture, “{0}:{1}”, username, api))); client.Timeout = 60000; client.Headers.Add(HttpRequestHeader.ContentType, “application/json”); client.Headers.Add(HttpRequestHeader.Authorization, “Basic ” + authorizationKey); tracer.Trace(“jsonData: ” + jsonData); createBatchResponseJSON = client.UploadString(basicURL, jsonData); } tracer.Trace(“createBatchResponse :” + createBatchResponseJSON); Model.MailChimpContactCreateBatchResponse createBatchResponse = GetInfoFromJSON(createBatchResponseJSON); CreateMailChimpSyncRecord(createBatchResponse, tracer, service, marketinglistid); The JSON request to be passed is given below: The JSON response for the BATCH call is given below: 3. Create an action “MailChimp status” which triggers on MailChimp Sync record creation. Mail Chimp API call is made to get the status of the synchronization process. Batch ID is the unique value which helps to retrieve the status of sync call. If status is finished, sync process is completed. The code to be included in the action is given below: This is a GET request to check the status and update the status record in CRM. //// Call the web service using (WebClientEx client = new WebClientEx()) { string authorizationKey = string.Empty; authorizationKey = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(string.Format(CultureInfo.InvariantCulture, “{0}:{1}”, username, api))); basicURL = basicURL + “/” + batchId; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(basicURL); request.Accept = “application/json”; request.Method = “GET”; request.Headers.Add(“Authorization”, “Basic ” + authorizationKey); using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) using (Stream stream = response.GetResponseStream()) using (StreamReader reader = new StreamReader(stream)) { getBatchResponseJSON = reader.ReadToEnd(); } } tracer.Trace(“createBatchResponse :” + getBatchResponseJSON); Model.MailChimpContactCreateBatchResponse createBatchResponse = GetInfoFromJSON(getBatchResponseJSON); //// Update the MailChimp Sync record with new status UpdateMailChimpSyncRecord(createBatchResponse, tracer, service, currentRecord.Id); The JSON response for the GET request is given below: 4. Create workflows that keep on checking the status of the batch call. The initial batch call is a sync process and we get a status showing no. of record finished and pending. Thus, the syncing process takes place in background. Therefore, we need to create workflows to keep on checking in specific interval. In the initial call, we have kept waiting time of 5 min and then kept waiting time of 1 hour and called the same workflow again till we get the status of batch call as “finished”. a. Main Workflow: b. Child Workflow 1 Check Mail Chimp Sync. c. Child Workflow 2 Check Mail Chimp Sync. For more code details, you can refer the GitHub link. Hope it help you and thus we can integrate the CRM with Mailchimp and make use of MailChimp API calls listed in their documentation. Members can be added individually or by using the batch operations. You can refer the below links from MaiChimp which shows how we can make individual and batch calls. i. Creating a new member ii. Batch Operations
Share Story :
Creating a New Module in Dynamics 365 for Finance and Operation
Introduction: In Dynamics 365 New Modules are created using Menu. This is Customization in Dynamics 365 for Finance and Operations. Steps: Following are the Steps of Implementation: Step 1: Create a Menu Item Add a new Item to your Project . Under Dynamics 365 Items go to User Interface. Select Display Menu Item and give appropriate name to it. Now open the Designer and Set the Properties of the Menu Item. Set the label Name for the Menu Item, Specify the Object to Run under Object. Refer this Menu Item under the Properties of Menu. Step 2: Create a Menu Add a new Item to your Project Under Dynamics 365 Items go to User Interface Select Menu and give appropriate name to it. Now open the Designer and Set the Properties of the Menu. Set the Label Name for the Menu under Appearance and Menu Item name under Data. Step 3: Link the Menu Item under Menu Open the Menu Drag and drop the Display Menu Item from the Solution Explorer to the Menu. Step 4: Display the New Module Open the AOT and expand the Main Menu. Right click and click on Create Extension. You will be able to see the MainMenu.Extension in your solution Explorer. Rename it and open in Designer. Right click on the MainMenu.Extension and add new Menu Reference. Rename the Reference Menu and set its Properties. Set the Menu Name to the Menu Created in Step 2 Compile your Project You can see your Module in the Main Menu.
Share Story :
How to Connect with Dynamics 365 and use Lookup Field of Dynamics CRM in PowerApps.
Introduction: This blog explains how to Connect with Dynamics 365 and use Lookup Field of Dynamics CRM in PowerApps. Steps for Creating Connection to Dynamics 365: Go to https://web.powerapps.com Create a new Connection with Dynamics 365. Click on New Connection and search for Dynamics 365. Select Dynamics 365 and click on Create. Enter the Credentials for the Connection. Steps for Creating an App: Go to App and Click on Create an App. Under Start with your data select Phone Layout for Dynamics 365. Now Select Connection and choose a dataset from that Connection. Select the Entity from the list. Click on Connect. PowerApps will create Browse, Details and Edit screen for you. Browse Screen: You can search for the record and see all the records which are created. Detail Screen: It gives details of record which is selected in Browse Screen. Edit Screen: You can create or update the records from this Screen. Important : The current Dynamics 365 connector does not support lookup or option set data types. so we’ll demonstrate how we worked around the lookup limitation. Example: For contact entity there is Lookup field for accounts.To use Lookup Datatype in contacts for account you must add account entity also in PowerApps. Steps for adding Account Entity: Go to View -> Data Source -> Select the Connection Choose Dataset->Select Account Entity ->Connect. Now Make changes on each screen so that you get account name instead of GUID of account entity. Browse Screen: Select the field in which you want to display account name. Under Text Property of that field write : LookUp(Accounts , accountid = ThisItem._parentcustomerid_value , name) Now it will return the name of Account instead of GUID. Detail Screen: Select the field in which you want to display account name. Under Text Property of that field write : LookUp(Accounts, accountid = ThisItem._parentcustomerid_value , name) Now it will return the name of Account instead of GUID. Edit Screen: Steps: Create a new Blank screen name it as account lookup. Add Gallery control inside Blank Screen and set its items property to accounts. Select the next arrow and set its OnSelect property to : ClearCollect( Selectedaccount, { Account: Gallery1.Selected } ); Back() Now Go back to Edit Screen Select the Data Card of Company Name and Go on Advanced Properties and Unlock the Data Card. After Unlocking the Data Card Add search icon inside the Data Card. Now select that Data Card of Company Name and set its Default value to:If(IsBlank(First(Selectedaccount).Account.accountid ) , ThisItem._parentcustomerid_value , First(Selectedaccount).Account.accountid ) Select the Data Card value of Company Name and set its Default value to:LookUp(Accounts, accountid= ThisItem._parentcustomerid_value , name) Select the Data Card and set its update Property to:Gallery1.Selected.accountid Select the search icon and set its OnSelect property to:Navigate(‘account lookup’,ScreenTransition.Fade) Select the Data Card of Company Name Type field and set its Default value to: “accounts” Select the form and set its OnSuccess Property to:Clear(Selectedaccount);Back() Select the Cancel icon and set its OnSelect Property to:Clear(Selectedaccount);ResetForm(EditForm1);Back()
Share Story :
Dynamics CRM Marketing list members sync with MailChimp- Part 1
Introduction: This blog will depict an idea on how we can integrate the members of CRM Marketing List to MailChimp Marketing List. Description: We had a requirement to add all the members from CRM static marketing lists to Mail Chimp marketing list. There were many marketing lists in CRM and exporting/importing data for each marketing list was a repetitive process each time we add a member to the list. Thus, we created some customizations in CRM with respect to the MailChimp API functionalities. These customizations will help your organization to minimize the manual efforts of adding members to Mail Chimp marketing lists. Only thing you need to do is to click on the custom sync button present on the marketing list record. CRM customizations are listed below: Provide a manual option on CRM marketing list to sync the list members to the MailChimp marketing list. These will work for members of type Contacts and Leads. Account members cannot be synched because it does not have an email address field. (MailChimp API main parameter for synching any member is the Email address of the member. It does not create duplicate records in MailChimp). Create a field on Marketing list which stores a unique marketing list ID from MailChimp. This value is important as this will help usl to link CRM and MailChimp lists. Create an configuration entity in CRM to store Mail chimp API key, MailChimp username, MailChimp URL.MailChimp URL for developer purpose is given below: https://<dc>.api.mailchimp.com/3.0 The <dc> part of the URL corresponds to the data center for your account. For example, if the last part of your MailChimp API key is us6, all API endpoints for your account are available at https://us6.api.mailchimp.com/3.0/. Below is the link to get or create a API key in MailChimp. How to create/get API key Write a custom action which calls the MailChimp API. Below are the links for synching the members individually and to perform the sync operation in batches. Each Member Sync Sync Members In Batches Create a MailChimp sync entity to record the sync status. The sync takes place in background in MailChimp thus we need to create this entity and keep a sync check by calling the MailChimp API to retrieve the batch status. Once the status is finished, sync will complete and all the members will be synched to MailChimp Marketing list.Below is the screen shot which will show the below details: How many records completed How many records errored Submitted and Completed date Status of the sync process. You can see the status of the sync by opening the record. Status finished denotes the syncing process is completed. In the next blog, we will discuss on the MailChimp API call in action.
Share Story :
Error ‘An error occurred during report data sets execution’ in D365 Operations
Introduction: In this blog article, we will see how to resolve timeout error in D365 Operations. Refer below screenshot for error. This error occurs when a report is processing many records and takes too long to execute. A report processing times out in 10 minutes. Steps: To resolve the error, follow below steps, Go to Tmp Table and change its Table Type property to TempDB. Go to RDP class and extend the class from SrsReportDataProviderPreProcessTempDB Save, Build and Deploy the Report.
Share Story :
Data Export Service in Dynamics 365 – Part 1
Overview: Welcome to this 2-part blog series on Data Export Service in Dynamics 365. This is an Add-on service made available as a Microsoft Dynamics 365 Online solution that adds ability to replicate D365 Online data to Azure SQL datastore in a customer based Azure subscription. Supported Target Destinations – Microsoft Azure SQL Database Microsoft Azure SQL Server on MS Azure Virtual Machine Data export initially synchronizes schema and data and thereafter, delta changes as they occur. Prerequisites: Your Dynamics 365 Online instance must be December 2016 update or higher Entities should be enabled for Change Tracking. Code is run in the context of a user with Sys Admin role. You’ll need to link your Office 365 to the Azure Subscription i.e. add the Office 365 tenant in the Active Directories of the Azure Subscription Azure SQL Database and user with correct permissions to be setup Install Data Export Service from the App Source from within your Dynamics 365 Dynamics 365: You can get this in the App Source of the Dynamics 365 and add it to your organization. On selecting the same, proceed with the Wizard by accepting terms and conditions And it will setup in the background Once completed, it will appear in the Settings area in Dynamics 365. Settings > Data Export 4. One successfully authenticating with Azure, you’ll see this disclaimer to which you have to click OK to proceed. Setup Azure SQL Database: To be able to run the test successfully, you’ll need to setup SQL Database on your Azure Customer Subscription. 1. I have the following SQL Server created in my Azure account. 2. And the following database created under it. To be able to do #3 below, you must do the following: The subscription must support the volume of data being replicated from your Dynamics 365 instance. Configure an Azure SQL Database server-level firewall rule using Azure Portal. Recommended to Allow access to azure services to be enabled. 3. And finally, connect my SQL to the database hosted on my Azure. Create Access Permissions for Users in SQL Open the Master Database and create a user for the user ‘dataexport1’ for the database. This user is then used in the Dynamics 365 Data Export Service to connect to the database Once done, use the below script to create the user in the created Azure SQL database We gave db_owner access to the user to provide full permissions. Link your Office 365 tenant to your Azure AD (if required) If your Office365 and Azure accounts are different, you can add the Office 365 in your Azure by doing the following: Navigate to Azure portal and then select Active Directory Then, click on + New from the bottom and chose Use existing directory as option and proceed. You’ll be logged out and asked to login again using the Office 365 credentials you want to add. Once signed in, the Office 365 tenant will be linked to your Azure Subscription and seen as below in the Active Directory area Now, what we’ve accomplished so far is – Adding Data Export Service to your D365 instance Setting up Azure SQL and connecting the same from your SQL Adding your O365 tenant to the Azure Subscription (option) In the next part, we will see – Creating Key Vault in Azure to store the connection strings to the Azure SQL Creating a Data Export Profile Testing out the functionality. Key benefits of using Data Export Service. Part 2 of this blog series will be out early next week.
Share Story :
Configure Notes on Entity in D365 Portal
Transform administration calls into a vital preferred position with Dynamics 365 Field Service management software. It gives all that you need – from advanced work request planning to prescient support Elements 365 Field Service is intended for organizations who do deal with sites at a client’s home or premises. This can incorporate establishment, booked or repeating support, or reacting to break/fix issues. Any help based association that has an emphasis on conveying nearby establishments and break/fix will profit by Dynamics 365 Field Service. The test for these organizations is to improve the profitability of field based groups while additionally expanding consumer loyalty. With highlights including plan improvement, resource the board and receipt handling, Field Service is a start to finish arrangement that furnishes colleagues with admittance to what they have to take care of business. Introduction: This blog explains how to configure Notes on Entity in D365 Portal. Steps of Implementation: Below steps explain how to configure Notes section on Partner Work Order form in D365 Partner Field Service Portal. Create new Section for Notes on Form in D365 Field Service. Save and publish the changes. Navigate to the Portal -> click on the Entity Permission -> click on the new button. Create entity permission for Work order and screenshot for reference. Set Scope to “Global”. Enable all Privileges In this record -> go to child entity permission sub grid follow below steps and screenshot for reference. Create “Note” entity permissions for Work order. Set Scope to “Parent” Parent Entity Permission as “Work Order Comments” Enable all Privileges Navigate to the Portal -> click on the Entity Forms -> Open Work Order Entity Form. Set Tab Name as “None” on Entity Form and save record.Refer the below screenshot. Add Notes in Entity Form Metadata and screenshot for reference. Conclusion: Above description in blog configure Notes on Entity in D365 Portals and below is screenshot for reference.