Dynamics Portals – Using ‘Emojis’ in Entity Form and Entity List

Rajeev Pentyala - Microsoft power platform blog

In this article, lets see how to use Emoji’s to capture the data in Portal’s Forms.

Emoji1

It’s very simple to achieve. All you need to do is to set the Dynamics ‘Option Set’ field’s ‘Label’ with ‘Emoji’.

Below is the ‘HOW’ part.

Create an ‘Option Set’ field with ‘Emojis’:

  • In Dynamics, create a new ‘Option Set’ Field with 2 options
  • In the Option’s ‘Label’ paste the Emoji.

Emoji2

  • Place this ‘Option Set’ field on the Dynamics Form and View which are being referred in your portal’s ‘Entity Form’ and ‘Entity List’.

Make ‘Options’ to render side by side in Portal:

  • By default, ‘Option Set’ renders as ‘Drop down’ control in Portal.
  • To show the ‘Options’ as Side by Side, add a new ‘Metadata’ to ‘Entity Form’.

Emoji7Test the Emojis in Portal:

  • Navigate to Portal and open the ‘Employees’ view. Option Set value would renders as ‘Emoji’

Emoji5

  • Open the record and you…

View original post 38 more words

Power Apps Portal – Remove an Entity from Global Search

Rajeev Pentyala - Microsoft power platform blog

If you are not familiar with Portal ‘Global Search’, please refer my other article to learn the steps to configure global search for an entity.

In this article, how to remove global search for a configured entity.

Disable the ‘Search Index’:

  • Open the entity you would want to disable the ‘Global Search’ and navigate to ‘Views’ and open ‘Portal Search’ view.

GS_7

  • Rename the ‘Portal Search’ view and ensure the new name doesn’t have the Portal Search term.
  • Save & Publish.
  • This step will block the entity from getting indexed.
  • Connect to Portal and rebuild the ‘Search Index’ by navigating to ‘../_Services/about’ page and click on ‘Rebuild search index’.

GS_12Remove the entity from search filters in ‘Site Settings’:

  • Open the ‘Portal Management’ Model-driven App and go to ‘Site Settings’.
  • Open the ‘search/filters’ site setting and remove the entry for the entity you would want to disable Global Search.
  • As an…

View original post 19 more words

Hide and Show Subgrid on basis of selected option/value using JavaScript in MS Dynamics 365 CRM.

Scenario: We need to hide or show the “Service Request Details” Subgrid from the Contact form based on the condition if Do you want Raise Service RequestField is yes then show Subgrid else hide Subgrid see in the picture below.

Step 1: Get the Schema Name of Do you want Raise Service Request Field.

Step 2: Get the Schema Name of Service Request Details Subgrid, You can do this by opening the form editor and then double clicking on the specific sub-grid.

Step 3: Write JavaScript Code to Hide or Show.

function ShowhideSubgrid(executionContext) {
	    var formContext = executionContext.getFormContext(); // get the form Context
        var raiseRequest = formContext.getAttribute("cr40c_doyouwantraiseservicerequest").getValue(); // get the value of doyouwantraiseservicerequest 
        if(raiseRequest == 1)
       {
               formContext.getControl('servicerequestdetails').setVisible(true); //Show Subgrid
       }
       else
       {     formContext.getControl('servicerequestdetails').setVisible(false); //Hide Subgrid
       }
}

Step 4:  Go to Form Editor —->Form Properties—-> Add new Library ——-> Click New—> Register “ShowhideSubgrid” function on form load.

This image has an empty alt attribute; its file name is image-4.png

Step 5: Register “ShowhideSubgrid” function on “Change of Do you want Raise Service Request” Field.

Now, Check the Output

Do you want Raise Service Request” field is equals to “Yes” Subgrid is Visible.

Do you want Raise Service Request” field is equals to “NO” Subgrid is Not Visible.

Note: We need to Register our ShowhideSubgrid function Onload of Form and Onchange Do you Want Raise Service Request event handlers.

How to Set a Lookup Field to another Lookup Field using JavaScript in MS Dynamics 365 CRM.

This post main Aim to explain how to Set a Lookup Field to another Lookup Field using JavaScript 👷🏽‍♂️

Scenario: on the Contact form, we have the owner of the account (field OwnerId), and we have a custom field called Name of the Developer (cr40c_nameofthedeveloper), We need to set default value Name of the Developer Lookup to owner lookup on the form using JavaScript to default the field value.

New Record: Before Customization.

Existing Record: Before Customization.

When setting a lookup value using JavaScript in Microsoft Dynamics 365, the value you use has to be an array and the values in that array must be of type object. Within the object the required components are the id, logical name and the entity type.

Step 1: Get the Schema name of Name of the Developer.

Step 2: write java script code.

// Set a Lookup Field to another Lookup Field using JavaScript.
function Setnameofthedevelopervalue(executionContext) {
// Getting Form Context
var formContext = executionContext.getFormContext();
// First get the OwnerId lookup
// Getting the value of owner id
var OwnerId = formContext.getAttribute("ownerid").getValue();
// Getting the GUID of the lookup record
var Id = OwnerId[0].id;
// Name of the lookup record
var Name = OwnerId[0].name;
// Getting Entity Name of the lookup which entity the lookup record is belongs to.
var EntityType = OwnerId[0].entityType;
// Creating new lookup array
var lookup = []; // new Array
lookup[0] = {}; // new Object
lookup[0].id = Id; // GUID of the lookup id
lookup[0].entityType = EntityType; // Entity Type of the lookup entity
lookup[0].name = Name; // Name of the lookup
// Getting and Settiug New Lookup
var nameameOfTheDeveloper = formContext.getAttribute("cr40c_nameofthedeveloper").setValue(lookup); // replaceing the lookup field
}

Step 3:  Go to Form Editor —->Form Properties—-> Add new Library ——-> Click New—> Register “Setnameofthedevelopervalue” function on form load.

This image has an empty alt attribute; its file name is image-4.png
This image has an empty alt attribute; its file name is image-5.png
This image has an empty alt attribute; its file name is image-6.png
This image has an empty alt attribute; its file name is image-8.png

Step 3: Refresh Contact form page.

Step 4: Go to Contact entity and create New record check the output.

Step 5: Go to Contact entity and Open any existing record check the output.

New Record: After Customization.

This image has an empty alt attribute; its file name is image-20.png

Existing Record: After Customization.

This image has an empty alt attribute; its file name is image-23.png

How to Open Lookup Records in main record as a dialog / Pop-up in a model driven app of MS Dynamics CRM 365

With the 2020 Release Wave 1 update, a new method was introduced to open a new or existing record in a Main Form Dialog.

In this blog, we will be discussing one of these new features which aims to help the end-user. This feature will allow the user to open a lookup record in a dialog 😉.

Through the Main Form Dialog, users are no longer forced to leave forms when opening a related record. This has the immediate benefit of reducing clicks and delays when users need to go back to the previous record as this remains in the background.

The user can also perform further actions like edit and save the record without opening the record. Previously, many users have implemented this functionality using custom logic, but Microsoft has introduced this feature to help you do that easily and quickly.

For more details, please refer the existing blog post from Microsoft that introduced the feature HERE, as well as details in Docs site HERE.

Step 1: Get the Schema name of field of Lookup which you want to open.

Step 2: write java script code to open Lookup Records in main record in a dialog.

function openAccountLookupModalDialog(executionContext) {
    var formContext = executionContext.getFormContext(); // Getting FormContext
    var lookupControl = formContext.getControl("parentcustomerid"); 
    lookupControl.addOnLookupTagClick(onLookupClick);
}

function onLookupClick(executionContext) {
    executionContext.getEventArgs().preventDefault();
    var record = executionContext.getEventArgs().getTagValue();
    Xrm.Navigation.navigateTo({
        pageType: "entityrecord",
        entityName: record.entityType,
        entityId: record.id
    }, {
        target: 2,      //2 - Open record in modal dialog
        width: 
        {
            value: 80, 
            unit: "%" 
        }
    });
}

Step 2: Go to Form Editor —->Form Properties—-> Add new Library ——-> Click New—> Register “openAccountLookupModalDialog” function on form load and change the lookup field.

Step 3: Refresh Contact form page.

Step 4: Click on the Account look up field.

All JavaScript Changes – Dynamics 365 9.0

Bansal Blogs - Dynamics 365, PowerApps, Microsoft Flows, Power BI

JavaScript Model Changes ||    New Client APIs     ||     Deprecated Client APIs

J1

There are significant changes made to Client APIs in Dynamics 365 version 9.0 release. Table below lists four main changes happened in this release:

Execution Context Use execution context to retrieve form or grid context instead of using    Xrm.Page which is deprecated in this release
Global Context New API added to Xrm.Utility object to retrieve information specific to organization, user or client where script is executed instead of using Xrm.Page.context which is deprecated in this release
New Client APIs Number of new namespaces and APIs introduced with this release

New namespaces:

  • Xrm.Device
  • Xrm.Encoding
  • Xrm.Navigation
  • Xrm.WebApi

New APIs in existing namespaces:

  • formContext.data – onload, isValid, saveOptions, saveMode
  • formContext.data.entity – getEntityReference, isValid
  • formContext.ui – onload event handlers
  • Xrm.Utility – getEntityMetadata, getGlobalContext, lookupObjects, showProgressIndicator, closeProgressIndicator

Refer link for complete list.

Deprecated APIs Some of client APIs are deprecated:

  • Xrm.Page
  • Xrm.Page.context
  • GridRow.getData
  • GridRowData.getEntity

View original post 1,221 more words

Get the Data In

Power BI has many data input sources, it has 200+ connectors to get data and Get data option in Power BI desktop is used to get data into Power BI.

Once you click on Get Data option we get the option from most used connectors and 200+ connectors. Also if you want to use the old data sets which are already used by you click on Recent sources(will show the options/ connections used earlier). Below image shows gives you an idea on getting data options. (All 3 don’t come at once). We have another option to get data is by manually entering data by clicking Enter Data option.

Once data is into Power BI we have an option to transform the data(Clean, Manipulate data), we have in house tools to clean and transform our data or we can use M – Language. Select the table or tables and click on the option you needed.

If you choose to Load data into PBI with out transforming, It will load data and show you columns in Fields (right section).

We will see what happens when we Transform data in another blog.

Please take a minute and provide your valuable feedback. Thanks

Some Important Facts About BPF

Friyank Parikh Blog

  • In Each stage, there should be at least one data step, for E.G if you have 5 data steps in one Stage, and if you try to delete any four it will allow, but for last remaining one it wont allow you to delete.
  • No Max limit of Draft BPF, But You can have only 10 Active BPF at a time.
  • A single BPF can have Max 5 different Entity, There is no limit to use same entity again and again.
  • Each stage can have one Entity, Cannot have multiple entity for same stage. but you can have multiple stage for Same Entity.
  • You cannot have more than 30 Stages per BPF.
  • Max 30 Data Steps for single Stage.
  • But if you keep adding more Stages, beyond the limit of 30 it will allow.
  • You will get Error for more than 30 stage while Saving or…

View original post 544 more words

Dynamics 365 – Sub grid Add Existing Look up View N:N

xrm CRM Dynamics

Requirement:

When I click Add Existing button on the subgrid want to see only records based on the view.

Subgrid N:N relationship

Steps to be followed.

1.Create a N:N relationship of the entity.

2.Using that N:N relationship add a subgrid on the form.

3.Created a javascript file.Add the below code to it.Save and Publish.

Code:

function SubgridLookup(selectedEntityTypeName, selectedControl, firstPrimaryItemId, primarycontrol) { debugger; var formContext = primarycontrol, formId = formContext.ui.formSelector.getCurrentItem().getId(); if (selectedControl.getRelationship().name === "new_knowlwdgearticle_knowledgearticle") { if (formId && formId === "f7502aaf-4874-49fc-868d-cc201c677678") { var viewGuid = "E2991C12-25D7-4BF0-A4DA-DC561A94678"; } else if (formId && formId === "g3682787d-4874-49fc-868d-cc201c677678") { var viewGuid = "E2991C12-78YR-4BF0-A4DA-DC561A94678"; } var options = { allowMultiSelect: true, defaultEntityType: "knowledgearticle", entityTypes: ["Knowledgearticle"], defaultViewId: viewGuid }; lookupAddExistingRecords("new_knowlwdgearticle_knowledgearticle", "knowledgearticle", "knowledgearticle", firstPrimaryItemId, selectedControl, options, primarycontrol); } else { // Any other contact relationship (N:N or 1:N) - use default behaviour XrmCore.Commands.AddFromSubGrid.addExistingFromSubGridAssociated(selectedEntityTypeName, selectedControl); } } function lookupAddExistingRecords(relationshipName, primaryEntity, relatedEntity, parentRecordId, gridControl, lookupOptions, primarycontrol) { debugger; Xrm.Utility.lookupObjects(lookupOptions).then(function (results)…

View original post 343 more words

{Dynamics 365 Web API} Create Notes with Attachment

xrm CRM Dynamics

Today I will explain how to create Notes with Attachment in CRM using Web Api. In order to create Attachment we need to convert the content to Base64String and pass the content as string in request body to CRM.

Code to create Notes with Attachment using Javascript Xmlhttprequest


var entity = {};
entity.subject = "ABCDDDDDDDDDDDDd";
entity.notetext = "Test Detailsnn";
entity.filename = "File.txt";
entity.isdocument = true;
entity.documentbody = "TU0gVGV4dCBGaWxl";
entity["objectid_account@odata.bind"] = "/accounts()";

var req = new XMLHttpRequest();
req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v9.1/annotations", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function() {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 204) {
var uri = this.getResponseHeader("OData-EntityId");
var regExp = /(([^)]+))/;
var matches = regExp.exec(uri);
var newEntityId = matches[1];
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(entity));

Code to create Notes with Attachment using Web API

 var entity = {}; entity.subject = "ABCDDDDDDDDDDDDd"; entity.notetext…

View original post 89 more words

Create your website at WordPress.com
Get started