Get and Set values of Data Types in Microsoft Dynamics CRM Using Java Script

Get and Set values of Data Types in Microsoft Dynamics CRM Using Java Script

Get and Set values of Data Types in Microsoft Dynamics CRM

Using Java Script

There are 13 datatype available in Dynamics 365.

  1. Single Line of Text
  • Multiple Line of Text
  • Option Set
  • Two Options
  • Lookup
  • Decimal
  • Date and Time
  • Whole Number
  • Floating Point Number
  • Currency
  • Multi Select Option Set
  • Image
  • Customer

 

The following statements guide you on how to get and set the respective values.

 

1.Datatype: Single Line of Text (or) Multiple Line Of Text

 

 

    • Get Value:

var str = Xrm.Page.getAttribute(“attribute logical name”).getValue();

        • Ex :  Var str = Xrm.Page.getAttribute(“new_singleline”).getValue();
    • Set Value:

Xrm.Page.getAttribute(“attribute logical name”).setValue(“Test”);

        • Ex : Xrm.Page.getAttribute(“new_txtsingleline”).setValue(“Test”);

2. Datatype: Option Set

 

 

    • Get Value:

var Opvalue = Xrm.Page.getAttribute(“attribute logical name”).getValue();

        • This will return selected option value.
        • Ex : Var Opvalue = Xrm.Page.getAttribute(“new_optionset”).getValue();
      • var Optext = Xrm.Page.getAttribute(“attribute logical name”).getText();
        • This will return selected text value .Like Vendor,Customer,Retailer
        • Ex :  Var Optext = Xrm.Page.getAttribute(“new_optionset”).getText();
    • Set Value: (Option Set)
      • Xrm.Page.getAttribute(“attribute logical name”).setValue(1);
        • Ex : Xrm.Page.getAttribute(“new_txtoptionset”).setValue(1);

 

 

Datatype: Two Options

 

 

    • Get Value:

var TwoOpvalue = Xrm.Page.getAttribute(“attribute logical name”).getValue();

        • This will return true or false
        • Ex : Xrm.Page.getAttribute(“new_twooptions”).getValue();

var TwoOptext = Xrm.Page.getAttribute(“attribute logical name”).getText();

        • This will return selected text value .Like yes or No.
        • Ex : Var TwoOptext=Xrm.Page.getAttribute(“new_twooptions”).getText();
    • Set Value: (Two Options)

Xrm.Page.getAttribute(“attribute logical name”).setValue(TwoOpvalue);

        • Ex : Xrm.Page.getAttribute(“new_txttwooptions”).setValue(TwoOpvalue);

 

  • 4. Datatype: Lookup

 

    • Get Value:

var lookupValue = Xrm.Page.getAttribute(“attribute logical name”).getValue();

var ID= lookupValue [0].id;

        • Will return id of the selected record.

var Name= lookupValue[0].name;

        • Will return selected text value.

var LogicalName= lookupValue[0].entityType;

        • Will return selected record logical name.

Ex : var lookupValue = Xrm.Page.getAttribute(“new_txtlookup”).getValue();

 

    • Set Value: (Lookup Field)

Xrm.Page.getAttribute(“attribute logical name “).setValue([{ id: “record Guid”, name:“recordname(Optional)”, entityType: “entity logical name” }]);

Ex : Xrm.Page.getAttribute(“new_txtlookup”).setValue([{ id: ID, name: Name, entityType: LogicalName}]);

Or

 

Var lookupval=new Array();

lookupVal[0] = new Object();

lookupVal[0].id = Id;

lookupVal[0].name = Name;

lookupVal[0].entityType =LogicalName;

 

   Xrm.Page.getAttribute(“new_parentcustomerid2”).setValue(lookupVal);

5. Datatype: Decimal

 

    • Get Value:
      • var decvalue= Xrm.Page.getAttribute(“attribute logical name”).getValue();
        • Ex : Var decvalue= Xrm.Page.getAttribute(“new_decimal”).getValue();
    • Set Value:
      • Xrm.Page.getAttribute(“attribute logical name”).setValue(decvalue);
        • Ex : Xrm.Page.getAttribute(“new_txtdecimal”).setValue(decvalue);

6. Datatype: Date and Time

 

    • Get Value:
      • var datetime= Xrm.Page.getAttribute(“attribute logical name”).getValue();
        • Ex: var datetime= Xrm.Page.getAttribute(“new_datetime”).getValue();
    • Set Value:
      • Xrm.Page.getAttribute(“attribute logical name”).setValue(datetime);
        • Ex : Xrm.Page.getAttribute(“new_txtdatetime”).setValue(datetime);

7. Datatype: Whole Number

 

    • Get Value:
      • var Wholevalue = Xrm.Page.getAttribute(“attribute logical name”).getValue();
        • Ex : Var Wholevalue = Xrm.Page.getAttribute(“new_wholenumber”).getValue();
    • Set Value:
      • Xrm.Page.getAttribute(“attribute logical name”).setValue(Wholevalue);
        • Ex : Xrm.Page.getAttribute(“new_txtwholenumber”).setValue(Wholevalue);

8. Datatype: Floating Point Number

 

    • Get Value:
      • var Floatvalue= Xrm.Page.getAttribute(“attribute logical name”).getValue();
        • Ex : Var Floatvalue= Xrm.Page.getAttribute(“new_floatnumber”).getValue();
    • Set Value:
      • Xrm.Page.getAttribute(“attribute logical name”).setValue(Floatvalue);
        • Ex : Xrm.Page.getAttribute(“new_txtfloatnumber”).setValue(Floatvalue);

9. Datatype: Currency

 

    • Get Value:
      • var Currencyvalue= Xrm.Page.getAttribute(“attribute logical name”).getValue();
        • Ex : var Currencyvalue= Xrm.Page.getAttribute(“new_currency”).getValue();
    • Set Value:
      • Xrm.Page.getAttribute(“attribute logical name”).setValue(Currencyvalue);
        • Ex: Xrm.Page.getAttribute(“new_txtcurrencyvalue”).setValue(Currencyvalue);

10. Datatype: Multi Select OptionSet

 

    • Get Value:
      • var Mulopvalue= Xrm.Page.getAttribute(“attribute logical name”).getValue();
        • Ex : var Mulopvalue= Xrm.Page.getAttribute(“new_multiselectoptionset”).getValue();
    • Set Value:
      • Xrm.Page.getAttribute(“attribute logical name”).setValue(Mulopvalue);
        • Ex : Xrm.Page.getAttribute(“new_txtmulopvalue”).setValue(Mulopvalue);

11. Datatype : Customer

 

Customer datatype is similar to lookup but it contains only account and contact entity type only.

    • Get Value:

var lookupValue = Xrm.Page.getAttribute(“attribute logical name”).getValue();

var ID= lookupValue [0].id;

        • Will return id of the selected record.

var Name= lookupValue[0].name;

        • Will return selected text value.

var LogicalName= lookupValue[0].entityType;

        • Will return selected record logical name.

Ex : var lookupValue = Xrm.Page.getAttribute(“new_txtlookup”).getValue();

 

    • Set Value: (Lookup Field)

Xrm.Page.getAttribute(“attribute logical name “).setValue([{ id: “record Guid”, name:“recordname(Optional)”, entityType: “entity logical name” }]);

Ex : Xrm.Page.getAttribute(“new_txtlookup”).setValue([{ id: ID, name: Name, entityType: LogicalName}]);

Or

Var lookupval=new Array();

     lookupVal[0] = new Object();

     lookupVal[0].id = Id;

     lookupVal[0].name = Name;

     lookupVal[0].entityType =LogicalName; // account or contact

     Xrm.Page.getAttribute(“new_parentcustomerid2”).setValue(lookupVal);

 

Attach images in KB in Dynamics 365

Attach images in KB in Dynamics 365

Attach images in KB in Dynamics 365

Scenario

To add images in knowledge article, we need to provide the image URL. In CRM we can add image as a web resource and we can get the URL of the image.

To achieve this, I have created a custom entity to create an image web resource

Entity Name : New_WebResource

Attribute Name Attribute Type
Name Single line of text
Image URL Single line of text –Format (URL)
Image Type Option set (PNG -5 , JPEG -6)
Image Description Multiple lines of text
base64_value Multiple lines of text

Step 1

Create a web resource with the type as html and add the below code. The below html will help you to upload the image and can get and set the base64 value of the uploaded image in “base64_value” attribute.

</p> <p><html><br /> <head><meta><meta><meta><meta><br /> </head><body style="overflow-wrap: break-word;"><br /> <input id="inputFileToLoad" type="file" accept="image/*" onchange="encodeImageFileAsURL();"></p> <div id="imgTest"></div> <p><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script><br /> <script type="text/javascript"> function encodeImageFileAsURL() { var filesSelected = document.getElementById("inputFileToLoad").files; if (filesSelected.length > 0) { var fileToLoad = filesSelected[0]; var fileReader = new FileReader(); fileReader.onload = function(fileLoadedEvent) { var srcData = fileLoadedEvent.target.result; // <--- data: base64 var newImage = document.createElement('img'); newImage.src = srcData; document.getElementById("imgTest").innerHTML = newImage.outerHTML; window.parent.Xrm.Page.getAttribute("cmp_base64_value").setValue(document.getElementById("imgTest").innerHTML); } fileReader.readAsDataURL(fileToLoad); } } </script></body></html></p> <p>

Step 2

Open entity’s main form and add all the above attributes. Click on web resource in form editor and choose our web resource from step 1.

Step 3

Create a new web resource with the type of java script. Add the below code.

function getstring(context)
{
var type;
var textdescription=Xrm.Page.getAttribute('cmp_base64_value').getValue();
//checks the base64_value is null or not
if(textdescription ==null)
{
//if the uploaded file is not an image then the base64_value is null and shows the alert.
alert("please choose image file.");
var saveEvent = context.getEventArgs();
saveEvent.preventDefault();
}
if(textdescription != null)
{
//splitting the unwanted characters from base64_value, to get the exact base64 value of the image.
var removelast2character= textdescription.slice(0, -2);
var getbeforecomma= textdescription.slice(0, textdescription.lastIndexOf(","));
var format=getbeforecomma.split('/')[1];
var finalformat=format.split(';')[0];
var teste=removelast2character.split(',')[1];
if(Xrm.Page.ui.getFormType() == "1")
{
//Create web resource (custom entity)
if(finalformat=="png" ||finalformat=="PNG")
{
//Image type is PNG
var type=5;
create(type, teste);
}
else if(finalformat =="jpeg" || finalformat =="JPEG" || finalformat =="jpg" || finalformat =="JPG")
{
//Image type is JPG
var type=6;
create(type,teste);
}
else
{
//Image type is not equal to PNG (Or) JPG
alert("Record has not been published. Please select PNG (or) JPEG type image");
Xrm.Page.getAttribute('cmp_base64_value').setValue("");

var saveEvent = context.getEventArgs();
saveEvent.preventDefault();
//preventAutoSave(econtext);
}}}}

function create(type, base64str)
{
if(Xrm.Page.ui.getFormType() == "1")
{
//Creating web resource in Dynamics 365.
//Below is the url format of the web resource location. Change it for your CRM org.
var url="https://mastermind8.crm8.dynamics.com//WebResources/";
var imagedescription=Xrm.Page.getAttribute("cmp_imagedescription").getValue();
var name=Xrm.Page.getAttribute("cmp_name").getValue();
var nowname=name.split(' ').join('');
var bytevalue=Xrm.Page.getAttribute("cmp_base64_value").getValue();
var entity = {};
entity.content = base64str;
entity.webresourcetype = type;
entity.name = "new_"+nowname;
entity.displayname = name;
entity.languagecode = 1033;
entity.description = imagedescription;

var req = new XMLHttpRequest();
req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/webresourceset", 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];
var nowurl=url+"new_"+nowname+"?preview=1";
Xrm.Page.getAttribute("cmp_imageurl").setValue(nowurl);
if(type=="5")
{
Xrm.Page.getAttribute("cmp_imagetype").setValue(5);
}
else
{
Xrm.Page.getAttribute("cmp_imagetype").setValue(6);
}
setTimeout(function () {Xrm.Page.data.entity.save(); }, 2000);
} else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(entity));
}
}

Step 4

Navigate to form editor click on Form Properties, add our library and in Event handler call the “getstring” function in “On Save” event of form. Select the check box “Pass execution context as first parameter.” Because we have used the context in our function.

Step 5

Save the form and then click on “Publish”. Navigate to Service sitemap and click on “Web Resources”.

Note: I have selected “Service” sitemap to display this entity (new_webresource).

Step 6

Create new. Upload JPG or PNG image and click on “Save”.

Step 7

After save, the URL of the image will be populated. Copy the image URL.

Step 8

Navigate to “Customer Service Hub” and click on “Knowledge Articles”. Create New. In Content area click on image icon and paste the copied Web resource URL from step 7, then click “OK”. Save this KB and publish it. Now it is visible in Knowledge article. We can refer this KB in case and it will show the KB text content and images.

Step 9

Open a new case and search this KB. It will show the KB content. We can attach this with our case for reference.

Happy CRMing..!

This article was written by Monika Sri

Reasons to Integrate Marketo with your business software

Reasons to Integrate Marketo with your business software

Reasons to Integrate Marketo with your business software

Marketo Integration

In today’s competitive world marketing is too important to be left only with the marketing team. Marketing is the core of any business and only innovative marketing could help in getting better ROI. Marketing software like Marketo has changed the way of marketing once and for all. Gone are the days where they were considered only to be sending Emails and simple marketing co-ordinations.Nowadays Marketo Integration helps in marketing to take them to new horizons.

What is Marketo Integration?

Marketo is an account-based marketing automation tool to help in managing combined sales and marketing efforts. The evolution of Marketo for more than a decade now has only benefited business in innovative marketing ways. Now integrating it into various other applications and systems bring in far better results than using it separately. They could be integrated by Bedrock data, the integration partner of Marketo.

What are the applications and systems Marketo could be integrated?

To facilitate marketing in an innovative and systematic way of integrating Marketo with business software is essential. They could be integrated without any further cost with the following applications for giving better marking strategies and solutions:

Reasons to integrate Marketo in business software

Integrating Marketo in business software could yield mind-boggling changes in the way of marketing of an organization. The major benefit of integrating Marketo with CRM could give right ROI for any marketing campaign. The continuous and constant monitoring of specific areas of interest of marketing benefits could help improve marketing for better ROI. The following are some reasons why Marketo should be integrated into business software:

  • To analyze the current trend and change the marketing campaign as per the trend for better results
  • Optimizing the efficiency of marketing by cloning many programs like e-mail, landing pages and others
  • Managing lead generation campaigns, e-mail marketing, and other lead nurturing activities
  • Evaluate marketing programs and their performance on a day to day basis
  • Providing qualified leads to the sales team at the right time for better marketing results
  • Closed-end reporting to evaluate the ROI any time of the marketing campaign
  • Tracking sales leads back to certain marketing strategies which were successful and replicating them in other areas of business
  • Data from Marketo integration will help in analyzing the demography and behavior of the qualified leads to make the prospects of the business
  • Integration of CRM with Marketo will enable a better seamless database connection. This leads to up to date and accurate data available for making professional marketing.
  • The leads can be aligned with the lead scores obtained by them through various metrics. This will facilitate following the important leads rather than the lesser ones. This could save time and be beneficial in finalizing the right ones at the right time.
  • A suitable marketing campaign could be created with the help of a lead database from Marketo with other sales tools.

Integrating Marketo with the business software ensures their success by sending the right message at the right time to the right people.

Integrating POP3/SMTP with Dynamics 365

Integrating POP3/SMTP with Dynamics 365

Integrating POP3/SMTP with Dynamics 365

How to integrate POP3/SMTP with Dynamics 365?

We can use server-side synchronization to synchronize Dynamics 365 with Gmail, Outlook, Yahoo, and other POP3 email servers.

POP3 – Sync yahoo incoming email with dynamics 365 email activities.

SMTP – Send email from dynamics 365.

Note, however, that you can’t synchronize appointments, contacts, and tasks with POP3 email servers.

Follow these steps to integrate Dynamics 365 to POP3/SMTP Servers.

Step 1

Yahoo Account

First Enable Less Secure Apps in your yahoo account.

  • Select your profile -> click Account Info -> Account Security
  • Allow apps that use less secure sign-in to Yes

Gmail Account

In Gmail to permit external access to the mailbox using POP3 protocol.

Click Settings > Forwarding and POP/IMAP tab.

In the “POP3 Download” section, select Enable POP for all mail (If you don’t want emails prior to now to be synced, then select Enable POP for mail that arrive from now on).
In When message is access with POP drop down list select archive Gmail’s copy and click Save Changes.

Enable Less secure Apps in your Gmail account.

Login into Gmail -> Select My Account in your Gmail profile -> Sign-in & Security -> Apps with Account Access -> Allow Less Secure apps to On

Hotmail Account

Login to your Hotmail account -> View all outlook settings -> Sync Email ->Enable POP to YES

Step 2

Go to Dynamics 365 instance →Settings → Email Configuration → Email Server Profiles → Click New Button → POP3/SMTP Server

In dynamics 365 instance Microsoft Exchange Online profile is created by defaults. So, we must create a new profile to configure POP3/SMTP servers (Yahoo, Gmail, and Hotmail) account with Dynamics 365.

Step 3

– Enter name of your profile.
– Enter incoming and out coming server location for your POP3/SMTP servers

Yahoo

  • Incoming Server Location : pop.mail.yahoo.com
  • Out coming Server Location : smtp.mail.yahoo.com

Gmail

  • Incoming Server Location : pop.gmail.com
  • Out coming Server Location : smtp.gmail.com

Hotmail

  • Incoming Server Location : pop3.live.com
  • Out coming Server Location : smtp.live.com

– In credentials section select Authentication type as Credentials Specified by a User or Queue
– Select same settings for Outgoing its set to YES

Step 4

Click Advance tab and enter the incoming and out coming port for your POP3/SMTP servers

Yahoo

  • Incoming Port : 995
  • Out coming Port : 587

Gmail

  • Incoming Port : 995
  • Out coming Port : 587

Hotmail

  • Incoming Port : 995
  • Out coming Port : 587

– Click Save & Close

Step 5

Settings → Email Configuration → Email Configuration Settings

In Default Microsoft dynamics 365 process the email using Email Router. We are configuring email with Server-side synchronization. So, select Server-Side Synchronization as process method

  • Select server profile as newly created server profile (Ex: Yahoo profile, Gmail profile)
  • Incoming Email: Server-Side Synchronization or Email Router
  • Out coming Email: Server-Side Synchronization or Email Router
  • Click Ok to save the configuration.

Step 6

Go to Settings → Email Configuration → Select mailbox to do configuration

  • Select Allow to Use Credentials for Email Processing to YES
  • Enter your User Name of your account (Ex: xyz@yahoo.com , xyz@gmail.com )
  • Enter password of your account.

Step 7

In Synchronization Method section change the following settings

  • Select your newly server profile(Ex: Yahoo profile, Gmail profile) in Server Profile Lookup
  • Incoming Email : Server-Side Synchronization or Email Router
  • Out coming Email : Server-Side Synchronization or Email Router
  • Click Save.

Step 8

  • Click Approve Email Button in ribbon.
  • Then click Test & Enable Mailbox, and in the popup window uncheck the check box [if it is checked] and click Ok.

Then the email processing its start. It takes few minutes to validate the configuration. Few minutes later Incoming and Out coming Email Status is change to Success.

This article was written by Yogeswari KJ

How to track read/unread emails in Dynamics CRM

How to track read/unread emails in Dynamics CRM

How to track read/unread emails in Dynamics CRM

Dynamics CRM does not have a provision to track read/unread emails. So we have to do customization to track the email status.

Business Logic

Create a two-options type field (custom field) in email entity. The values must be “Yes” and “No” and the default value of the custom field must be “No”. When user opens the incoming email the custom field value is changed to “Yes”.

Follow this steps to track read/unread emails.

Steps 1

First create a two-option type field in Email entity.

Ex:

Custom attribute name: new_emailreadstatus – Values “Yes” & “No”. Default value is set to “No”

Steps 2

Create new webresource (JavaScript) in Dynamics CRM and copy and paste the below code in webresource.

Code

function setreadstatusemail ()
{
// Check form type is “Update”, because when user opens the existing email in CRM, the form will go in an “Update” form type.

if (Xrm.Page.ui.getFormType() == “2”)
{
var statuscode=Xrm.Page.getAttribute(‘statuscode’).getValue();

// we can track read and unread status for incoming emails only. In CRM incoming emails are in “Received” statuscode. So we have to check whether the statuscode of the email as “Received”.
//In CRM the “Received” statuscode values is “4”.

if(statuscode==”4″)
{
var stringstatus=”No”;

// Replace your custom attribute name
var emailreadstatus=Xrm.Page.getAttribute(new_ emailreadstatus).getText();
alert (emailreadstatus);

// check the emailreadstatus values is equals to “No”. So the email in unread status.
if(emailreadstatus==stringstatus)
{
alert (“Unread email”);

var emailid = Xrm.Page.data.entity.getId();
var updatedemaild=emailid.substr(1).slice(0, -1);

// whenever we try to update the new_emailreadstatus attribute in email entity, by default the form will be in read only mode.
// In CRM Received emails are in Read Only mode. We can’t update anything in the form.
// So first change the email statuscode to “Draft” and email status to “Open” then update the new_emailreadstatus value to “Yes” and again change the email statuscode to “Received” and email status to “Completed”
// using XMLHttpRequest, change the status of the email to “Open” and statuscode to “Draft”.

var entity = {};
entity.statecode = 0;
entity.statuscode = 1;
var req = new XMLHttpRequest();
req.open(“PATCH”, Xrm.Page.context.getClientUrl() + “/api/data/v8.2/emails(” + updatedemaild+ “)”, 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)
{
//Success – No Return Data – Do Something
//Set new_emailreadstatus as “Yes” in customfield.
Xrm.Page.getAttribute(‘new_readunread’).setValue(1);
// Then change the email status code to “Received” and status to “Completed”
changestatuscodetoreceived(updatedemaild);
}
else
{
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(entity));

}
if(status==”true”)
{
Alert (“Email already read”);
}
}
}

}
function changestatuscodetoreceived(updatedemaild)
{
// use XMLHttpRequest to change the email statuscode to “Received” and status to “Completed”
var entity = {};
entity.statecode = 1;
entity.statuscode = 4;

var req = new XMLHttpRequest();
req.open (“PATCH”, Xrm.Page.context.getClientUrl() + “/api/data/v8.2/emails (” + updatedemaild+ “)”, 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)
{
//Success – No Return Data – Do Something
Xrm.Utility.openEntityForm(Xrm.Page.data.entity.getEntityName(), Xrm.Page.data.entity.getId());
}
else
{
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send(JSON.stringify(entity));
}

Step 3

Call the webresource in onload event of email entity. Save and publish the customizations.

Step 4

After publishing open the Received email the new_emailreadstatus is changed to “Yes”.

This article was written by Yogeswari KJ

The growing importance of Business Intelligence

The growing importance of Business Intelligence

The growing importance of Business Intelligence

“Knowledge is past and intelligence is present” is an adage which squarely applies to today’s digitalized business world. In this competitive world business intelligence alone could make businesses successful. Business intelligence is a technique of transforming the collected data into information. CRM or customer relationship management is an effective business intelligence form for better results of the companies. Microsoft business intelligence or MSBI is a modern technique for successful business development.

MSBI tools

The following are the Microsoft business intelligence tools that could form an organization’s database for analyzing and transforming them into actionable information for their development.

  • SQL server data tools or SSDT
  • SQL server integration systems (SSIS)
  • SQL server analysis services (SSAS)
  • SQL server reporting services (SSRS)
  • Business intelligence development studio
  • Database management systems
  • Extracts, Transforms Load Tools (ETL)

How business intelligence help business development

Data and the tools to analyze them are out in the open in this digitalized business world. It is the business intelligence which acquires these data and stores them in a database for analyzing them in the right way to take companies to the next level. It should be the fundamental and integral part of any business for major improvements and sustenance in the future.

Importance of business intelligence

Even without the help of IT staff or other help multiple areas in an organization like sales, finance, customer satisfaction is benefited by business intelligence. They include:

Human Resource

A track of the employee’s ability, productivity, performance, scores, utilizing technological tools, payrolls, satisfaction levels and many more could be done with HR BI dashboards.

Customer Satisfaction

Demand and supply trends among the target audience, analyzing consumer trends, consumer behavior, formulating a business plan or strategy, production, manufacturing, budgeting and many could be enhanced with business intelligence. Also, it improves the relationships between businesses and customers.

Finance

Tracking budgets, visual insights into financial data, overall business health, potential problem areas and many more could be helped with business intelligence for taking a financial decision which could frame the future of the companies.

Boost ROI

For any company, the return of investment is the sole purpose for business. This could be well boosted with the business intelligence by the strategic awareness of the following:

  • Insight into the workings
  • Trends & analytics of the business process
  • Faster reporting
  • Lowering the operating costs
  • Manufacturing the products as to the requirements of the consumers
  • Effective working of the business process
  • Managing day to day efficiency
  • Sales deal conversion metrics
  • Enterprise-wide deployments

Sales

For companies to visualize sales cycle, display conversion & churn rates, total revenue, tracking the pipeline and many more will improve the performance of the sales to new levels which is the need of any company for its better future.

Reduce risks

Enables access to details and analytics about the businesses to identify risks which are not efficient for the growth of business and make informed decisions.

Marketing

Enhances tracking engagement, performance, trends, cost per lead, website traffic, and analytics of all marketing campaigns.

Business intelligence is the need of the hour for any organization for sustaining in this digitalized competitive business world.

Import data in Dynamics 365 using Templates

Import data in Dynamics 365 using Templates

Import data in Dynamics 365 using Templates

In dynamics 365, there is way to import data using entity templetes. We can download this template for any entity and import data into Dynamics 365. Here are the steps.

Step 1:

Login to your organisation and navigate to ‘Settings’ area and select ‘Data Management’.

Step 2:

Click on ‘Templates for Data Import’.

Step 3:

This is the popup window will be shown after completing step 2. From the dropdown we can download template for any entity. Choose entity and click download button.

Step 4:

Open the downloaded template add any number of records in it and save the excel file.

Step 5:

Now navigate to ‘Settings’ -> ‘Data Management’ and click on ‘Imports’.

Step 6:

Click on ‘Import Data’ button.

Step 7:

Now, click on ‘Choose file’ button and select your saved excel file from step 4.

Step 8:

Here you can allow or restrict duplicate records creation based on duplicate detection settings. You can also change the owner of the records by selecting from the user lookup. By default, login user is selected as the owner of importing records. Click ‘Submit’ button to start importing.

Step 9:

Initially importing status reason shows as ‘Submitted’. The total number of records processed will be shown under ‘Total Processed’ column.

Step 10:

Record count of successful import will be shown under ‘Successes’ column. If any error occurred during import, those record count will be shown under ‘Error’ column. We can double click on any record and see the import information such as success, failure reason etc. after the completion of import process the status reason will be changed as ‘Completed’.

Step 11:

Now navigate to ‘Sales’ area and select ‘Accounts’.

Step 12:

That’s it. Account data imported successfully. You can change the view and see the data as you wish.

Happy CRMing..!

This article was written by Monika Sri

On record select event of editable sub grid

On record select event of editable sub grid

On record select event of editable sub grid

The introduction of editable grid in Dynamics 365 is very useful to do inline editing of records. This will now provide the ability to group by or sort by any column, allows filtering & filter controls for lookup fields. We can enable editable grid for an entity and for a sub grid. Let’s look at the steps to activate editable grid for a sub grid.

Scenario:

Let’s consider the scenario that, there is a sub grid (Product entity) in opportunity entity. Whenever we select any product from the sub grid, the product should be added in opportunity product entity.

Step 1:

To insert sub grid in opportunity entity, Open the Opportunity form in form editor, click on insert tab, then click on “Sub grid”.

Step 2:

Give a proper name and label for a sub grid. Under data sources choose record type as “All Record Types”. Because there is no relationship between Opportunity and Product. Select default view based on requirement.

Step 3:

Navigate to “Controls” tab of the sub grid and click on the link button called “Add Control”. Then click on “Editable Grid”.

Step 4:

Now it will show the configuration and properties of the editable grid. Choose editable grid control for web. You can also enable it for phone and tablet. There is an option to enable or disable the ‘group by’ and filter option for editable grid.

Step 5:

Navigate to “Events” tab. Add libraries and call functions in sub grid events. Here I have called my function in on record select event of the sub grid. The reference code is below.

Step 6:

Add selected product in opportunity product:

To add the selected product in opportunity product, a validation has been done that the product is already added in opportunity product or not. If “No” then confirmation dialog will be shown, and the product will be added otherwise it just refresh the grid and throw an alert saying that “Already added”. Call the below function in the “on record select” event of sub grid.

function getselectedrecords()
{
var grid = window.parent.document.getElementById(“FilteredProductGrid”);
var OppProductgrid=window.parent.document.getElementById(“opportunityproductsGrid”);
var Oppid=Xrm.Page.data.entity.getId();
var OppGuid= Oppid.substr(1).slice(0, -1);
var selectedRows = Xrm.Page.getControl(“FilteredProductGrid”).getGrid().getSelectedRows();
selectedRows.forEach(function(selectedRow, i) {
var entityGuid = selectedRow.getData().getEntity().getId();
var check=”New”;
XrmServiceToolkit.Rest.RetrieveMultiple(“OpportunityProductSet”, “?$select=OpportunityId,ProductId&$filter=OpportunityId/Id eq (guid'”+OppGuid+”‘)”,
function(results) {
for (var i = 0; i < results.length; i++) { var opportunityId = results[i].OpportunityId; var productId = results[i].ProductId; if(productId.Id===entityGuid) { check="Old"; alert("This product is already added!"); grid.control.Refresh(); OppProductgrid.control.Refresh(); } } }, function(error) { Xrm.Utility.alertDialog(error.message); }, function() { //On Complete - Do Something }, false); if(check==="New") { Xrm.Utility.confirmDialog("Do you want to add this product?", function() { var entity = {}; entity.OpportunityId = { Id: OppGuid, LogicalName: "opportunity" }; entity.ProductId = { Id: entityGuid, LogicalName: "product" }; entity.Quantity = parseFloat(1).toFixed(5); entity.UoMId = { Id: "9334a168-ca23-47d9-bd38-07d69cfdce1c", LogicalName: "uom" }; XrmServiceToolkit.Rest.Create(entity, "OpportunityProductSet", function(result) { var newEntityId = result.OpportunityProductId; }, function(error) { Xrm.Utility.alertDialog(error.message); }, true); grid.control.Refresh(); OppProductgrid.control.Refresh(); alert("Selected record Added!"); return; }, function(){ grid.control.Refresh(); OppProductgrid.control.Refresh(); }); } }); }

Step 7:

To filter the records in Sub grid: (Optional)

We can filter the sub grid data based on certain criteria. This step is not mandatory. You can use this function if you need to filter data in a sub grid and call this function wherever you need.

function subgridFilter()
{
if(Xrm.Page.ui.getFormType() !=”1″)
{
var grid = window.parent.document.getElementById(“FilteredProductGrid”);
var cityvalue = Xrm.Page.getAttribute(“new_city”).getValue();
var roomsneeded=Xrm.Page.getAttribute(‘new_requiredrooms’).getValue();
var cityid = “00000000-0000-0000-0000-000000000000”;
var cityname;
if (cityvalue != null)
{
var cityid = cityvalue[0].id;
cityname=cityvalue[0].name;
}
if(grid == null)
{setTimeout(function () {subgridFilter(); }, 2000);}
Else{
var GUIDvalue = Xrm.Page.data.entity.getId();
if(grid.control !=null){
var FetchXML =
“+
“+
“+
“+
“+
“+
“+
“+
“+
“+
“+
“+
“+
“;

grid.control.SetParameter(“FetchXML”, FetchXML);
grid.control.Refresh();
}
else{
setTimeout(function () {subgridFilter(); }, 3000);}
}
}}

Happy CRMing..!

This article was written by Monika Sri

Creating SSRS Report for Dynamics 365 Online

Creating SSRS Report for Dynamics 365 Online

Creating SSRS Report for Dynamics 365 Online

What is SSRS?

SQL Server Reporting Services (SSRS) is a server-based reporting platform that allows us to create and manage a wide variety of different types of reports and deliver them in a range of formats.

Required Components:

https://www.microsoft.com/en-us/download/details.aspx?id=50375

Follow the steps below to create and deploy the report in Dynamics 365 Online.

Step 1:

Open Visual Studio → Create new project

Step 2:

Select Business Intelligence Template → Reporting Services → Report Server Project Wizard → Enter the Project Name and click OK.

Report Wizard will be shown

Step 3:

Enter the Data source name, select the Type as “Microsoft Dynamics 365 Fetch” and enter your connection string (Dynamics 365 URL) also enter your logon credentials for Dynamics 365. Then click Next.

Then the query design page will display. You can get the query from dynamics 365 advance find.

Step 4:

Go to dynamics 365 instance → click Advance Find

In advance find build a query (for example Retrieve All Accounts information like Name, Account Number, and Address) and execute the query in Advance Find.

Click Download Fetch XML

Check the downloaded fetch xml query

Step 5:

Copy the fetch XML code and paste it in the query string section

Click Run in Query builder so that you can see the query results from dynamics 365 online.

Step 6:

Now you can select the type of your report as Tabular / Matrix, and click Next

Design the table and click Next

Step 7:

Specify the Report Name and click Finish.

You can edit the table design as per your need, save and build the project.

Step 8:

Go to Dynamics 365 Instance. Select Reports

Step 9:

Click New to create new report.

Step 10:

In New Report form select Report type as Existing file, Click Choose File to select the rdl file. Enter Name for this report and select report categories then save the report.

Run Report in Dynamics 365 its looks like below.

Happy CRM ing!

This article was written by Yogeswari KJ

CRM Systems – 4 Reasons Why It’s Your Most Valuable Asset!

CRM Systems – 4 Reasons Why It’s Your Most Valuable Asset!

CRM Systems – 4 Reasons Why It’s Your Most Valuable Asset!

Simply make a survey and you would learn that around 5 companies out of 10 are managing their important business operations with the help of the spreadsheets. There are chances that the spreadsheets might get outdated or lost. Tracking, managing, updating could be difficult and it would lead to serious threat when the document reaches the wrong hands. Similarly, the Business cards are among the best sources to collect customer data, but they finally end up lying in the drawer or card holder. The lack of collaboration in all such methods would result in poor customer interaction.

The database of the customers increases in terms of value when every employee works unitedly in populating it along with the data. And this is where the Microsoft Customer Relationship Management works miracles. The CRM not only helps by building customer strategies but also adds strategies that add lead nurturing.

Let’s mark up 4 prime reasons why CRM system is the most valuable assets for any company.

Focus on client interactions

Not everyone you approach and interact with would get converted into sale the same day. So, keeping them informed about the products and services you offer, and this would be the best idea. For this, organizing the contacts and customers should never be avoided. With the help of some basic categorization, you can turn the data efficient for implementing the strategy of CRM for meeting the requirements.

Track the customer interactions from everyone

While interacting with the customer or the prospect, you are sure to know the company and some basic details regarding the same. Hence, while talking with the customer, let him know that he is important. This would help in building healthy and long-term relationships. Emails here play a vital role due to which they should be kept in your system and not in the inbox of every candidate.

Helps in framing a way to sales

There must be a long list of unsold prospects in your system, right? This happens when a customer says NO and you dump them in the unsold list. But at times, this NO actually means NOT TODAY. The CRM actually keeps such data on active mode and with the help of effective marketing strategy with emails, the business benefit later in achieving their plans.

Holds your customer

The candidates would change the job anytime. At that time, losing the data due to lack of registration of candidates, lack of updating, etc. just because the relevant details were not stored is surely something you wouldn’t like to block your way to preserving the most valuable assets, right?

CRM is the key to focus on the customers. By investing in Microsoft Customer Relationship Management, the businesses are sure to invest in productivity and profits too. So, do you agree CRM system would be helpful for your business? Write to us.

This article was written by Subbu