D365 General Archives - Page 16 of 31 - - Page 16

Category Archives: D365 General

Integrate PowerApps with Dynamics 365

Posted On January 1, 2018 by Admin Posted in Tagged in

Introduction: This blog explains how to Integrate PowerApps with Dynamics 365. Keep the following restrictions in mind: Only PowerApps users in the same tenant can access the embedded app. To access PowerApps using Internet Explorer 11, you must turn off Compatibility View. Steps to be followed: In powerapps.com, on the Apps tab, click or tap the ellipsis ( . . . ), then Details. Copy the App ID. Substitute the [App ID]value in the URI.: https://web.powerapps.com/webplayer/iframeapp?hideNavBar=true&source=iframe&appId=/providers/Microsoft.PowerApps/apps/579938ff-e1a0-4891-a8b9-8d69c103fd84 Embed your app in a website: Embedding your app is now as simple as adding the iframe to the HTML code for your site.http://<iframe width=”[W]” height=”[H]” src=”https://web.powerapps.com/webplayer/iframeapp?hideNavBar=true& source=website&screenColor=rgba(165,34,55,1)&appId=/providers/Microsoft.PowerApps/apps/[AppID]”/> To add PowerApp inside CRM  as web resource: Keep the following points in mind for authenticating users of your app: If your website uses Azure Active Directory (AAD) based authentication, no additional sign-in is required. If your website uses any other sign-in mechanism or is not authenticated, your users see a sign-in prompt on the iframe. After they sign-in, they will be able to run the app as long as the author of the app has shared it with them Steps: Specify the width and height for App. Specify the app id. Sample HTML code: <!DOCTYPE html> <html>  <head> <title>HTML Iframes</title> </head> <body> <p>App Goes here…</p> <iframe width=”250″ height=”250″ src=”https://web.powerapps.com/webplayer/iframeapp?hideNavBar=true&source=website&screenColor=rgba(165,34,55,1)&appId=/providers/Microsoft.PowerApps/apps/579938ff-e1a0-4891-a8b9-8d69c103fd84″ /> </body> </html>  

Share Story :

Prepopulating Lookup and dropdown fields on a Form in D365 CRM Portals using JS

Overview: In this blog we will see how we can prepopulate lookup and dropdown (option set) fields on an Entity form in D365 CRM Portals using JS. Pre-Requisites: D365 CRM Portals D365 CRM Environment Introduction We know that if we want to prepopulate a lookup or a dropdown field on a form in CRM Portals the best method is to use Entity Form Metadata. But there is an alternative way to prepopulate the Lookup and dropdown (Option set) fields on an Entity form in D365 CRM Portals using JS. Scenario: To implement the functionality of prepopulating a lookup field we will be using the account lookup field on the CRM entity form based on the value entered in the contact field for a created opportunity in the partner portal. For the prepopulating the dropdown field we will be using the opportunity status field. Process: First of most we will see how to prepopulate the lookup field on the entity form based on the value entered in another field. As mentioned in the above scenario we need to prepopulate an account field on an opportunity form based on the value present in the contact field. To insert a value into a lookup field using JS(jquery) we need the following information as mentioned below. The field value to be displayed. For eg. Account full name. The GUID if the record to be displayed. For eg. GUID of the account record. The logical name of the entity. For eg. Logical name of the account entity. Now we will see how to get these details form the existing information we have on the opportunity form. When we open an opportunity record, on the details page in the URL section we get the id of the opportunity record as shown below We will insert this id into the fetch xml using liquid template to obtain details of the contact related to the following opportunity record as shown below. As shown above we have used the opportunity id in the fetchxml to get the contact details. Once we have obtained the contact details from which we will be using the contact name value in the next fetchxml to get the related account information. In the following below shown fetchxml we will get the value and the id of the account record to be inserted. Once we get the account record details we will write the jquery in the following manner to insert the value into the lookup field. Jquery syntax: <script> $(“form_attributeid_name”).val(“record_value”); $(“form_attributeid”).val(“record_GUID”); $(“form_attributeid_entityname”).val(“entity_logicalname”); </script> Once we publish the liquid code we will see that the account field on the opportunity form is prepopulated with the value related to the value present in the contact field. For prepopulating the dropdown(option set) field we need the option set value of the record to be displayed. To set the value in the option set we will write the following jquery. $(form_attributeid).val(“attribute_optionsetvalue”); Hope you all find this blog helpful. Happy coding in CRM portals.

Share Story :

Create and Associate records using Xrm.WebApi

Posted On December 30, 2017 by Clinton D'Mello Posted in Tagged in

Introduction: In this blog we will demonstrate how to create and associate records using Xrm.WebApi which provides methods to use Web Api to create and manage records. Implementation: Step 1: The syntax to create a new entity record is as follows: Xrm.WebApi.createRecord(entityLogicalName,data).then(sucessCallback,errorCallback); Here entityLogicalName(string) and data(object) parameters are required. The “data” parameter is a JSON object defining the attributes and values for the new record. Step 2: In this example we will create a sample account record along with a primary contact for that account, associate an opportunity to the account and create task and notes for the opportunity all in a single operation. This type of process is called as a deep insert. The code for the same is as shown below: var scripting = { recordCreation: function () { var data = { “name”: “CRAYONS LTD.”, “description”: “This Account is Created using a Web API”, “creditonhold”: false, “telephone1”: “9954565154”, “address1_city”: “Mumbai”, “primarycontactid”: { “firstname”: “Clinton”, “lastname”: “Dmello” }, “opportunity_customer_accounts”: [ { “name”: “Opportunity Associated to CRAYONS LTD.”, “Opportunity_Tasks”: [ { “subject”: “Task Created” } ], “Opportunity_Annotation”: [ { “subject”: “Note Created”, } ] } ] } Xrm.WebApi.createRecord(“account”, data).then( function success(result) { console.log(“Account Created with ID” + result.id); //perform operations on record creation }, function (error) { console.log(error.message); } ); } }; Step 3: In order to associate to an existing record @odata.bind annotation can be used. For Example: “primarycontactid@odata.bind”:”/contacts(GUID of the contact)”. Screenshots 1. A New Account is created with the name “CRAYONS LTD” and in the primary contact file the primary contact is set with the name Clinton Dmello as set in the code. 2. Also an opportunity is associated to the account as shown below in the associated view. 3. In the opportunity we can see the newly created task in the activities and a note as shown below. Hope this helped!

Share Story :

Actionable Audit App to access audit logs in D365

Introduction: In this blog we will see how audit logs in D365 can be fetched that can be used for reporting purposes. Auditing helps to track changes made to the data in D365. The System Auditing entity cannot be accessed. Actionable Audit is a App by Microsoft Labs in which the required audit logs can be stored in the actionable audit entity which can be used later on by fetching the records of that entity. This audit log can be helpful to create Dashboards in Power BI, create reports etc to get meaningful information from the data. Implementation: Step 1: First we enable the auditing for the organization(globally) in Settings > Auditing. Step 2: We then enable auditing for the required entities and fields. Step 3: Download the Actionable audit app from the AppSource. Step 4: After accepting the terms and condition is done, it will take some time to install the solution as shown in the notification below. Step 5: In the plug-in registration tool we can see the assembly MicrosoftLabs.ActionableAudit is present. Step 6: Out of the box some steps are already registered as seen below Note: Only if the field is enabled for auditing the logs will be stored in Actionable Audit entity. Step 7: If required, the out of the box plugin steps can also be unregistered. And we can also add custom entities to the list. The pre-image and post-images also must be registered for different message which is shown in the user guide in the AppSource. Step 8: After the logs are created they are stored in Actionable audit entity as shown in the below example. Hope this helped!

Share Story :

Manually Clearing Cache on ADX Portals to reflect changes made to Portals through CRM

Posted On December 29, 2017 by Admin Posted in

Introduction: People using ADX Portal often face the issue of clearing cache due to which changes aren’t being reflected on the frontend. In this blog we will see how a user can manually clear cache in ADX Portals to reflect changes made to Portals through CRM. Pre-Requisites: ADX Portals CRM Environment Scenario: One scenario mostly faced is that notes added in CRM in the activity section of a particular case aren’t appearing in the notes section on the case entity form in portals. The problem can be resolved by clearing the cache of the portals which will help to reflect the changes made to portals via CRM. We will see below how we can resolve the issue by using manual cache clearing technique. Process: Step 1: User while adding notes in CRM will have to add the prefix as *WEB* to the note. For eg. “*WEB*This note states the resolution of the case Step 2: The user will have to save the following ” javascript:var url=document.location.protocol+’//’+document.location.host+(document.location.host.indexOf(“demo.adxstudio.com”)!=-1?document.location.pathname.split(“/”).slice(0, 3).join(“/”):””)+’/Cache.axd?Message=InvalidateAll&d=’+(new Date()).valueOf();var req=new XMLHttpRequest();req.open(‘GET’,url,false);req.send(null);window.location.reload(true);”  as a Bookmark in the URL section in the Browser. For Chrome Browser: In Bookmarks section of chrome we will add a new bookmark as shown below: Select  “Add new bookmark” to add a new bookmark in the dropdown options Name the bookmark as “Cache Invalidate” and add the following to the URL   “javascript:var url=document.location.protocol+’//’+document.location.host+(document.location.host.indexOf(“demo.adxstudio.com”)!=-1?document.location.pathname.split(“/”).slice(0, 3).join(“/”):””)+’/Cache.axd?Message=InvalidateAll&d=’+(new Date()).valueOf();var req=new XMLHttpRequest();req.open(‘GET’,url,false);req.send(null);window.location.reload(true);”. Click on save once done. Enable “Show bookmark bar” which will display the added bookmark to the chrome ribbon. Step3: On opening the case page click on the saved Bookmark “Cache Invalidate” on the bookmark bar which will make the note visible in the note section. Conclusion: In this way we can manually clear the cache which will reflect the newly made changes to ADX Portals.  

Share Story :

New Email capabilities in Unified Interface – D365 v9

Overview: After much wait, the new Email feature in the Unified Interface is finally here. So this blog is about what all the new Email functionality can do in the Unified Interface. This feature is only for the Unified Interface. Now, you can see the Email button appearing on the ribbon. In the To field, you can select the record type in more intuitive way without having to load the Lookup view. Rich Text Editing: Now, the new Unified Interface offers Rich Text Editing capabilities wherein you can add new media to your email body. HTML Preview: Even you get to see the HTML preview of your email Preview of the Email You’d definitely want to see what goes out before sending the email out. You can also preview the final email before sending the same. Email: And this is how it looks when received by the recipient Hope this helps to a great start in email editing in D365!

Share Story :

Trick to find the fields Workflows trigger on

Introduction: This blog consists of information on how you can find the triggering parameter of the Workflow. Scenario: There are many workflows on update of a record and which workflow is triggering for which fields and on which fields the workflow is dependent on. It may be handy to identify which fields are being used to trigger workflows. You would open each workflow and check or you could click field in every entity and Check Dependencies. But there is much easier way for it. Solution: We can make use of Advance Find on the Process Entity. There are some fields like 1) Trigger On Update Attribute List 2)Trigger On Create 3) Trigger On Delete 4) Is Child Process This fields can be useful in many ways. Trigger On Update Attribute List has a field list separated by comma. This are the fields on which the workflow triggers.

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 :

How to Connect with Dynamics 365 and use Lookup Field of Dynamics CRM in PowerApps.

Posted On November 13, 2017 by Admin Posted in

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 :

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 :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange