{Thank You Note} It’s 50 not out and counting for our SharePoint Attachment Uploader and Metadata Manager tool

It’s 50 not out and counting for our SharePoint Attachment Uploader and Metadata Manager tool

A big thanks to all our customers who has helped us in our journey so far. Without your support, we would not have been able to reach this far.

A new version of the tool awaits with new feature and UI and is going to be released soon.

Thanks a lot for your support

image

 

Video Link – https://www.youtube.com/watch?v=BIhsOD0gbew

 

To know how we can help you, write to us at info@xrmforyou.com or visit our website – www.xrmforyou.com

Advertisements

Published at Mon, 28 May 2018 17:26:51 +0000

{Quick Tip} Pass a custom single/ collection of objects with Custom Properties as Output parameter from Actions in Dynamics 365

Pass a custom single/ collection of objects with Custom Properties as Output parameter from Actions in Dynamics 365

One of the great features that got introduced with Dynamics 2013 was Actions. With time more & more improvement came in with Actions and today Actions are one of the most powerful extending features in Dynamics.

And here I was designing actions for a client. Coming quickly to the requirement, the client had an action where they were determining complex business logic in the action with some input parameters and then based on the calculation, they need to pass back multiple values back to the invoker of the action.

There can be multiple ways to do this and one can be pass each of these values of Output Parameters. But that did not go well with the customer as around 15 properties needed to be returned from the action.

So the client developer came up with a DataModel class something similar to this.

 

internal class OutputClass

:

:

:

public decimal Property15

}

 

Nothing fancy. all the developer was doing was mapping the properties of this class and then the object back to the invoker of the action. But how to do it? Does Action allow custom object types to be passed as return parameters. Well,direct answer is No. But there are ways.

  • serialize the object into JSON and put the output JSON string through a string Output parameter – Didn’t go well with the customer. Has to abandon
  • serialize the object into XML and put the output XML string through a string Output parameter – Didn’t go well with the customer. Has to abandon again.

 

What I am left with then? We all know that it supports entity and entitycollection as output parameter types. But how do I use them to accomplish my goal here. The customer is not willing to create any Entity specifically for this.

Well a bit of trial and finally I achieved the below as workaround.

1. Passing a single Object back.

Well for this I used the entity parameter and just selected the Account Entity as Entity Type. You can use any Entity here. Does not matter.

image

 

In the plugin registered on the Action step, after calculating all the properties, I am setting the Output parameter like this.

var ent = new Entity("account");
ent["mytestproperty"] = "Test Name";
ent["mytestproperty2"] = 1;

ent["myentityreference"] = new EntityReference("contact", Guid.NewGuid());

context.OutputParameters["EntityParam"] = ent;

Observe carefully the code above. I am just creating an entity at runtime of type “account”. I don’t need to even specify the Guid. And then I can just put my custom property names for the entity and assign values of entity type – string/ int/ decimal/ entityreference etc.

None of these properties are present in the account entity. The trick is CRM framework does not validate the fields of the entity. So you can just return the entity object back with your own parameters. Cool trick. Isn’t it.

And below is the output received by the invoker of the action.

image

 

2. Passing Multiple Objects of Different type

For this, I used the entity collection as Output parameter

image

 

And below is the code to set the values.

var ent = new Entity("account");
           ent["mytestproperty"] = "Test Name";
           ent["mytestproperty2"] = 1;
           ent["myentityreference"] = new EntityReference("contact", Guid.Empty);

           var ent2 = new Entity("contact");
           ent2["mytestproperty"] = "Test Name";
           ent2["mytestproperty2"] = 1;
           ent2["myentityreference"] = new EntityReference("contact", Guid.Empty);

           collection.Entities.Add(ent);
           collection.Entities.Add(ent2);

           context.OutputParameters["CollectionParam"] = collection;

First we have to understand that entitycollection is a collection of entities. It does not necessarily imply collection of entities of the same type. This is a common misconception I find among so many people in spite of working on CRM for quite sometime.

As you can see, both the entities are of different types and can have completely different properties. Cool isn’t it?

And Below is the result the invoker of the action receives.

image

 

Personally if you ask me, I would still prefer serializing the object into JSON or XML. However if your customer prefers Entity or EntityCollection, this workaround I hope helps you.

 

Debajit Dutta

(Dynamics MVP)

For corporate training/ consulting/ tools, please visit our website www.xrmforyou.com or write to us at info@xrmforyou.com

Advertisements

Published at Mon, 28 May 2018 11:35:37 +0000

[unable to retrieve full-text content]

Published at

Place custom button on Registration Page in Dynamics 365 Portals

Place custom button on Registration Page in Dynamics 365 Portals

Recently I had a requirement where my customer wanted to put a Cancel button in the registration screen of Dynamics 365 Portal. To explain the requirement, the OOB screen looks like below.

image

What my customer wanted was to place the Cancel button beside the Register button. So that when he clicks on the Cancel button, it should throw the user back to the login page.

So let’s see how to do it.

Step 1: Create a content snippet

Go to settings –> portals –> content snippets

Create a content snippet with Name = Account/Register/PageCopy and Type = HTML. Check for the below screenshot

image

Save the record.

 

Step 2: Write the content of the HTML to render the Cancel button

Copy and paste the below in the Value (HTML) field

$(document).ready(function () );

});

There is one trick here. If you just Copy/ Paste the above code in the HTML field, it will render as text on the Registration Page.

image

So the trick is to follow the below steps before copy/ pasting the above code.

Click on the Source Icon as highlighted below. Once you click, it becomes a HTML editor.

image

Now copy and past the above code.

Save and refresh your portal.

image

 

Hope this helps!

 

Debajit Dutta

(Dynamics MVP)

For corporate training/ consulting, please write to us at info@xrmforyou.com

Advertisements

Published at Thu, 24 May 2018 03:18:15 +0000

[unable to retrieve full-text content]

Published at

GDPR-friendly Web Forms that Feed into Dynamics 365

GDPR-friendly Web Forms that Feed into Dynamics 365

With the deadline to meet the GDPR (General Data Protection Regulation) fast approaching, we want to make it easier for our customers to collect the consent they need from their clients, and track that in Dynamics 365. We’re going to be using the PowerWebForm add-on, which allows users to quickly and easily create a web form to post on their website, and feed the web form submissions directly into Dynamics 365. The GDPR-friendly form can be accomplished in just a few easy steps.

addons

1. Import the PowerWebForm add-on if you don’t already have it in your system, and register for a free, 30 day trial.

2. Create two new fields on your lead and contact entities: Consented, and consent date (or whatever you’d like to call them). The “Consented” field should be a Two Option type field, with the values Yes and No. The Consented Date field should be a Date type field.

3. Build the web form. To do this, navigate to the web form entity, under the PowerPack area and click New. Fill in the required information and Save (more details on exactly what each field does, can be found in the user guide). We’re choosing to create leads with our web form submissions, but you can create whatever you’d like. The cool thing about PowerWebForm is that duplicate detection is built in – for multiple record types! – so if the lead (or contact) already exists in the system, it won’t create a duplicate.

GDPR

4. Create fields for the web form, by scrolling down to the form fields section of the web form record and clicking the + sign on the grid. Make sure to create a Consent checkbox, which will be mapped to the field you created above. If you make this a required field, the person filling out the form will have to check the check box, in order to submit their inquiry. We’re going to choose to leave ours as not required.

GDPR

5. (Optional) If you’d like to set up duplicate detection for not just leads (which is what the web form above is currently checking on) but also for contacts, navigate to the related Duplicate Check entity, and create a Duplicate Check for contacts as well.

GDPR

To recap, here’s what we’ve done so far: Created a web form that looks for a duplicate lead in the system based on the email address entered on the form, and the email address entered on the lead, when a form is submitted. If a duplicate is not found, it will then go and look for a duplicate contact, based on the email address on the contact. If a duplicate is still not found, a new lead will be created and a web form activity will be created and associated to the newly created lead. If a duplicate lead OR contact is found, a web form activity will be created and associated to the existing lead. (note: the information on the lead/contact will NOT be updated).

The next step is going to be to create a workflow that updates the “Consented Date” and “Consented” fields on the newly created, or existing lead or contact, if they’ve checked the “Consented” check box on the web form. This workflow will only update those two fields, if the person submitting the form DID consent. So, we’ll need a parent workflow that checks the value of the form submission, and then a child workflow that updates the related lead or contact.

Parent workflow:

GDPR

Child workflow:

GDPR

Update step:

GDPR

Note: If you are doing this on multiple web forms, make sure that the “consented” field on the web form is exactly the same across all web forms. If it is, then you only have to build one set of workflows, as listed above, since the value will be the same if someone consents, no matter what form it’s on.

As always, it’s important to test your entire process, so you know that it’s working correctly. But that’s it! You now have a process that asks specifically for consent and tracks it back to the leads/contacts in your system.

For more helpful tips and tricks – subscribe to our blog!

Happy D365’ing!

Published at Mon, 21 May 2018 18:01:54 +0000

Security Nuances with Manager Based Hierarchy in Dynamics 365

Security Nuances with Manager Based Hierarchy in Dynamics 365

Manager Hierarchy was introduced way back with 2015 Online Update 1. And you might be wondering why this blog after years this feature has been introduced?

Well I can assure you, you won’t be disappointed after reading this blog. In this blog I will explain in detail the manager security nuances from my personal experience with project implementations and training. I am not going to explain how Manager security works. I am just going to explain the security nuances and how it works in multiple scenarios.

To explain my point, I have the below data set-up in my environment.

1. Business Unit Set-up

  • Americas –> Child BU of Root BU
  • North America –> Child BU of Americas

2. User Set-up

  • User A belonging to Americas BU
  • User B belonging to North America and reporting to User A
  • User C belonging to North America

3. Created Custom Entity named – Manager Hierarchy Test

4. Security Roles

  • Manager Role – having User level access on all privileges on the entity Manager Hierarchy Test
  • Reportee Role – having BU level access on all privileges on the entity Manager Hierarchy Test

5. User A is assigned Manager role and User B and User C having Reportee Role

So Manager Hierarchy affects which record? To put in my words

  • Owned by Reportee
  • Shared to Reportee
  • Owned by a team to which Reportee is a team member
  • Shared by a team to which Reportee is a team member

Which records are not affected by Manager Hierarchy ?

To put in simple terms, any of the records which does not meet the above four conditions is not affected by Manager Hierarchy. So the records which the reportee gains access due to his security prvileges (Business Unit/ Parent child/ organization) are not affected by this. Confused? Don’t worry. We will come back to this.

 

So let’s take these scenarios one by one.

Scenario 1:

Record owner = Reportee

User B creates a record – ‘Record for User B’. So this record is being owned by User B.  As per Manager Hierarchy, user A is able to read/ write this record since User B is direct reportee of User A. No surprises here right. After all everyone knows that.

First of all, to have write access to the reportee record, User A should be having at-least user level write privilege on the entity through his security role. Otherwise he won’t be able to write the reportee’s record even through Manager Hierarchy.

Also another point –Delete” privilege is not part of Manage security. Hence Manager won’t be able delete the reportee’s record.

 

Scenario 2:

Record shared to Reportee

Another user shares a record with User B with all the privileges – Read/ write/ append/ append to/ share. User A will now see this record because of Manager Hierarchy. However although the reportee have all the privileges on this record by virtue of sharing, through Manager Hierarchy, User A will only have read-only access to this record.

 

Scenario 3:

Record owned by a team which the reportee is member of

this behavior is same as Scenario1

 

Scenario 4:

Record Shared to a team which the reportee is member of

This behavior is same as Scenario 2

 

Now say for example User C goes ahead and creates record. Since User B and User C are both in the same business Unit (North America in example here), by virtue of their business unit read privilege on security role, User B would be able to see the record. However since User B is not the owner/ not shared to him/ not owned by the team to which he belongs/ not shared to the team to which he belongs, this record is not affected by Manager hierarchy and hence User A is not able to view this record.

 

Hope this clears out any doubt with Manager Hierarchy.

Debajit Dutta

(Dynamics MVP)

For corporate training/ consulting, please reach out to us at info@xrmforyou.com or visit our website – xrmforyou.com

Advertisements

Published at Tue, 15 May 2018 17:03:31 +0000

Headless Authentication with Dynamics CRM online and External Web App which requires Client Secret

Headless Authentication with Dynamics CRM online and External Web App which requires Client Secret

As promised, I am back to my second post on this topic. In my previous post, I showed you on how to generate Authorization token of D365 online from Native Console App using the Client_ID.

https://debajmecrm.com/2018/04/29/headless-authentication-with-dynamics-crm-online-web-api-without-user-login-screen-without-using-adal-part-i/

We did that using simple HttpWebRequest and Response and did not use the ADAL (Active directory authentication library) as well.

Well, let’s dive deep here. Nothing big in my previous topic as the same thing can be done using ADAL and in a clean way as well. Then why use that construct?

We are talking of headless authentication here which means authentication without user intervention. Using ADAL, it was fine to generate the token from a Native console APP using the Client ID. However situations become complex when we try to do the same from an external Web Application which required the Client_Secret as well for generating the token.

So I created a ASP.NET web application and registered in Azure. I got the client id and client secret after registering the Web App. How to do that? Well you have many wonderful blogs out there and I am not going to repeat the same.

Now comes the code part. Below is the code for the same. Look at highlighted line to check how I am passing the client id and client secret

My CRM URL is – https://xrm4u1.crm.dynamics.com

 

public string GetCRMToken()
/oauth2/token"”>https://login.microsoftonline.com//oauth2/token”,
azureTenantId);

var url = “https://xrm4u1.crm.dynamics.com”;
            var userName = “<username>”;
var password = “<password>”;

            // Connect to the authentication server

            var request = (HttpWebRequest)WebRequest.Create(requestUrl);
request.Method = “POST”;

            using (var reqStream = request.GetRequestStream())
&client_secret=&resource=&username=&password=&grant_type=password”,
clientId, clientSecret,url, userName, password);

var postBytes = Encoding.ASCII.GetBytes(postData);
reqStream.Write(postBytes, 0, postBytes.Length);
reqStream.Close();
}

            var accessToken = default(string);
using (var response = (HttpWebResponse)request.GetResponse())

}

            return accessToken;

        }

And delight is when you get the access token back. Now with the access token in your hand, you have the trump card. You can query Web API and what not.

Great isn’t it? To be honest with my readers, after this method without using ADAL worked out in my previous post, I just tried out sending the client secret in exactly the same way and it worked like a charm. Serendipity you can say!

Hope this helps.

Debajit Dutta

(Dynamics MVP)

For corporate training/ consulting please write to us at info@xrmforyou.com

Advertisements

Published at Mon, 30 Apr 2018 08:41:46 +0000

{Quick Tip} Restrict From Lookup in Dynamics 365 email to only queue–Without addCustomFilter or Unsupported Jscript

Restrict From Lookup in Dynamics 365 email to only queue–Without addCustomFilter or Unsupported Jscript

This is an old topic which is getting discussed since CRM 2011 or I think even before that. You must be wondering, why I am digging out history here. Well there has been so many blogs written about this.

So what’s the problem statement here?

Recently my customer wanted that whenever an email is being sent from Dynamics, it only needs to be sent through Queues. In other words in the From Lookup of the email, the user should not be able to select self or any other user from CRM.

So there are basically two steps to it. Since from is a multi-entity lookup, it shows both the user and queue when user tries to select.

So the first thing needed is to stop the user from selecting the user entity and the next is to stop the user from selecting any user record in from.

To achieve the first problem statement, so many blogs have been written but they use unsupported Javascript to meddle with the UI element and disable the dropdown. We will not do that here.

The other option, supported way, is to use the addCustomFilter. But with that, even though you stop from selecting a user, still the Entity selection of User/ Queue is available.

So wanna try something new? Let’s do this.

  • Create a solution and add the Email entity to it. While adding the entity, to keep the solution simple, just add the from field to it (only for CRM 2016 and above. Prior versions, you are not luck to choose the options)
  • Export the solution as Unmanaged
  • Unzip the solution. You should see three file
    • Customization.xml
    • Solution.xml
    • [Content_types].xml
  • Open the Customization.xml in a XML editor of your choice and navigate to the section where the From field is present.

image

  • You may find the unmodified=”1” in the attribute element as well as Email entity element. Remove the tags. Otherwise any changes you make here may not reflect in CRM once you import back.
  • Scroll down a bit and you will see the section with the LookupType tag.

image

  • Remove the entire element corresponding to 8 (Type code for user). Your final XML should just contain the one LookupType tag with Queue (2020).
  • All set and done, select the three files and re-zip them

image

  • Re-import the solution and publish all customizations.
  • Now go back to your CRM email. Try to select “from”. And get the delight. Now entity selection is disabled and you are just left with selecting the queue.

image

Advertisements

Published at Wed, 02 May 2018 13:16:34 +0000

{Quick Tip} Restrict To Lookup of email to allow only a record in Dynamics 365

Restrict To Lookup of email to allow only a record in Dynamics 365

Nothing like real time requirements and here is another one. Customer walks in and puts in his requirement – “Users should not be able to select more than one record in the To field of CRM”. We suggested that while sending the email, we would put a validation which would stop the user from sending the email if more than one record is there. Well as everybody knows, more often than not, customer has his way and then we were back to the drawing boards trying to figure out how to do it.

For starters, To field in Dynamics allows you to select more than one record of multiple entity types which is obvious isn’t it. Below is the UI which allows you to do that.

image

 

Fortunately we found out a way. This is what we did.

  • Created a solution. Added Email entity and the To field to it.
  • Exported the solution
  • Unzipped the solution and opened up customizations.xml file in a XML editor.
  • Navigated to the area where To attribute is there in the XML file.

image

  • Added the below in the XML file just above <displaynames> tag.

<LookupStyle>single</LookupStyle>

  • Re-zipped the files. Imported the solution back and Publish all customizations.
  • And now when you click the To field, this is what you get.

image

 

Mission accomplished!

Hope this helps.

 

Debajit Dutta

(Dynamics MVP)

For training/ consulting, please write to us at info@xrmforyou.com

Advertisements

Published at Fri, 04 May 2018 15:23:09 +0000

{Quick Tip} Certificate disappearing in IIS of CRM server even after successful import.

Certificate disappearing in IIS of CRM server even after successful import.

Before I proceed with the post. let me clear this out. There is nothing special about IIS server where CRM is installed. It applies to all IIS servers. However being a devotee of Dynamics for quite sometime now, can’t write any post without tagging CRM to it. Smile

So here I was working for a client with on-premise 2016 version. And their certificate is about to expire. They needed to generate a CSR for a SAN Certificate as wildcard certificates are not allowed by most of company policies.

So they used Open SSL to generate the CSR. For reader’s who might be interested in knowing how to generate SAN Certificate using Open SSL, https://geekflare.com/san-ssl-certificate/ provides a good example. And they got the certificate back from the Network team.

Now the D-day. They imported the certificate in Personal store and  also imported the certificate in IIS using ‘Complete Certificate Request’ option. All set and good.

But the moment they try to bind the certificate to dynamics CRM site, they could not find the certificate. Repeated this process. However the same behavior every time.

A bit of research and this is what comes up – “Certificate without private Key Information in it, cannot be binded to a IIS website.”

But how to do it?

When you generate a CSR request using Open SSL, the private key is output to a file. Usually the name is “Private.Key”, unless you specified something else.

So you have the private key and the certificate separately. But how to bind the certificate with the Private key?

Follow the below steps

  • Copy the Private Key file and the certificate to the Open SSL bin folder. Usually is it C:OpenSSL-Win64 for 64 bit machines and C:OpenSSL-Win32 for 32 bit machines
  • Open command prompt as administrator and navigate to the bin folder in the command prompt.
  • Run the below command

openssl pkcs12 -export -out certificate.pfx –inkey private.key -in certificate.crt –certfile

Here Certificate.pfx in the output certificate with the private key information and certificate.crt is the certificate you received from Network team.

Once the command completed successfully, you should be able to view Certificate.pfx in the bin folder.

Now all set and done. You will now just need to import this certificate to the IIS. But remember to use the “Import” option in the certificate window.

image

A rather off topic but hope it makes an interesting read.

Debajit Dutta

(Business Solutions MVP)

For corportate training/ consulting, please drop a note to info@xrmforyou.com or visit our website – www.xrmforyou.com

Advertisements

Author: Debajit

I am a Dynamics CRM Most Valuable Professional (MVP) with 10 years of experience in Microsoft .NET Technologies and 7 years of dedicated experience in Microsoft Dynamics CRM. I have worked with companies like Microsoft, SanDisk, PwC, TMF Group and have extensive experience of implementing complex CRM solutions from both offshore and client side.

Currently the face of XrmForYou.com with significant experience in delivering corporate training on Dynamics CRM and have already delivered multiple projects to client through XrmForYou.com

Author of multiple tools on codeplex including the ‘Role Based Views’ and ‘CRM-Sharepoint Metadata manager & Attachment Extractor’ which are available for commercial use under XrmForYou.com

For consulting/ training, drop me a note at info@xrmforyou.com or visit our website www.xrmforyou.com

Published at Sat, 28 Apr 2018 15:28:54 +0000

Take the Headache Out of Calculating Sales Tax with PowerSalesTax

Take the Headache Out of Calculating Sales Tax with PowerSalesTax

If most of us had our way, taxes wouldn’t be a problem we had to deal with, particularly when it comes to sales tax. Why? Because sales tax can be a pain to understand and figure out- especially for business owners. It can be a full-time job just monitoring new tax rules and making sure that your organization is compliant. There must be an easier way, right?

PowerObjects teamed up with the trusted third-party tax provider- Avalara, to relieve some of the headaches that come with understanding and populating sales taxes. With PowerSalesTax, users can easily and most importantly accurately calculate sales tax on quotes, orders, and invoices within Microsoft Dynamics 365. In today’s blog, we will explain just how PowerSalesTax can increase productivity and save you time!

PowerSalesTax

PowerSalesTax connects to your Avalara account using the AvaTax API, a subset of Avalara- an industry leader in sales tax management and compliance. Once the solution is imported and configured in your CRM environment, simply add the PowerSalesTax tab to any entity form, select Apply Tax and the solution will call out to Avalara to collect the tax information for you. This two-way connection ensures that real-time sales tax calculations flow directly from their up-to-date tax engine directly to the orders and invoices generated in your CRM. Just wait folks, it gets even better…

powersalestax

Need to calculate tax for multiple locations? No problem! PowerSalesTax uses the location entered in the “Address 1” fields on a record to calculate the appropriate tax for that region. City Tax (%), State Tax (%), Special District Tax (%), Country Tax (%), County Tax (%) will automatically be filled in with the percentage of tax that applies, based on the origin and address of the account you are taxing. Pretty cool, right?

powersalestax

For step-by-step instructions on how to set-up and configure PowerSalesTax in your Dynamics 365 environment check out the PowerSalesTax user guide. PowerSalesTax is one of thirty-one add-ons that PowerObjects has developed to enhance Dynamics 365 functionality. Like all PowerPack add-ons, a free 30-day trial of solution is available for download directly from the PowerSalesTax webpage. 

Happy Tax Season and Happy Dynamics 365’ing!

Published at Wed, 18 Apr 2018 17:20:07 +0000

[unable to retrieve full-text content]

Published at