A validation error occurred. The value of ‘membercount’ on record of type ‘list’ is outside the valid range exception in Dynamics 365 (CRM)

We were getting the below error while trying to delete one of the marketing list members from a static marketing list.

This occurs if the Members Count field has value 0 in it, even if there are members associated to it. (due to some exception)

Updating that field to correct value fixes this issue (customize the form to add the field on form). and we can then delete the members from it.

Hope it helps..

Advertisements

Using tpc.identity to get the logged in user details in JavaScript in The Portal Connector (TPC)

Recently while working in TPC, we had a requirement to get the details of the logged in user (which is basically a contact record in CRM).

To do so we can make use tpc.identity object in Client Side.

For e.g. contactId

Hope it helps..

Create a simple logic app with Dynamics 365 connector

Let us create a simple logic app that on create of a contact record in CRM creates the same contact in Gmail.

Log in to the azure portal.

https://portal.azure.com/#create/hub

Select New Logic App

Specify Name, Resource Group and Location for the logic app.

Select Blank Logic App

Select “When a record is created” as Trigger.

Sign in to Dynamics 365 Instance.

Select the Organization name and Entity as Contact.

Select Add an action and the New Step

Choose Google Contacts as the Service

Sign in to your Gmail account to be connected

Allow permission to Logic App to access Gmail

Configure Full Name and Primary Email (Dynamic content) as the values for the contact record to be created in Gmail.

Save and Run the app.

Create the new contact record in CRM that triggers the logic app.

On Successful run à

We can see the contact record created in Gmail.

Find all the details here

https://docs.microsoft.com/en-us/azure/connectors/connectors-create-api-crmonline

Hope it helps..

Using Multiple Choice Matrix and Likert Scape Option Sets in Web Form in Dynamics 365.

Let us continue with our previous example wherein we have already setup a sample Survey Web Form and added a Multi choice Field

https://nishantrana.me/2017/03/06/configuring-multiple-choice-field-for-web-form-in-portal-dynamics-365/

Here we would be making use of Multiple Choice Matrix.

For this first let us create 2 option sets in our Survey Entity. We’d put those field in Step 3 Tab.

  • Here we will use the existing global option set for Likert Scale which is added by the Portal in CRM.

Our first field – FacilityLikert Scale Satisfaction.

Our second field

Below are the different Likert Scale Global Option Set available within CRM added by Portal.

Now in the Survey form we have added a section named “Please Rate” and with the newly created fields inside it.

In the Web Form Step corresponding to the Step 3 tab and we added Web Form Metadata records one for each of the fields.

Style Multiple Choice Matrix
Group Name MCM

Refreshing the page in the Portal shows the option sets as Multi Choice Matrix

Hope it helps..

Configuring Multiple Choice field for Web Form in Portal (Dynamics 365)

Let us continue with our previous example and add a Multiple-Choice field for Step 3 Web Form Step as shown below.

https://nishantrana.me/2017/03/06/using-conditional-branching-in-web-form-in-portal-dynamics-365/

To configure this, add a section named “Please select all that applies” to Step 3 Tab and 3 two options (Boolean) fields in the Survey Form.

Now go to Step 3 Web Form Step and add Web Form Metadata for each of these bool fields.

For the poor management field,

  • Style – Multiple Choice
  • Group Name – MyGroup

For the poor salary field, specify the same value for style and group name field

  • Style – Multiple Choice
  • Group Name – MyGroup

Do same for the third two options field.

The main point to remember here is that the Group Name should be same.

Now open the portal page and go to the web form step.

The page shows the newly added Boolean Fields in the Web Form Step as checkboxes.

Hope it helps..

Using Conditional Branching in Web Form in Portal (Dynamics 365)

Let us continue with our previous example of Employee Exit Survey and add conditional branching step to it.

https://nishantrana.me/2017/03/05/using-web-form-to-create-a-simple-survey-in-portal-dynamics-365/

Here we’d add a conditional web form step which will check the response of the user for Work Life Balance question and in case if it false, it shows one more step to the user and asks for the comments.

So, let us first create a web form of type Condition with below details

Type Condition
Target Entity Logical Name Our custom survey entity
Next Step Web Form Step when condition is true
Condition If new_thirdquestion is true

Now let us see the details of web form step – third step which we have defined as Next Step for the condition Web Step above.

We have also created associated Web Form Metadata record of the type attribute for defining the label and other properties for the new field named fourth question in our survey form.

Adding label –

Adding Description –

Making field required –

Finally update the Second Web Form Step to point to the Condition Step

We are done with our configuration, now going back to our web page shows the Web Form with all the 3 steps.

Clicking on next with No as the answer for the Work Life balance Question shows the third web form step. Note here we can see the label defined, description defined and also the field is mandatory which we did using Webform Metadata.

Clicking on submit without specifying comments shows the required field message

All the details here

https://community.adxstudio.com/products/adxstudio-portals/documentation/configuration-guide/web-forms/web-form-steps/conditional-step/

Hope it helps..

Using Web Form to create a simple survey in Portal (Dynamics 365)

Web Form are an extension of Entity Form, which can be used for Surveys, Registration or any wizard sort of interfaces etc. which could involve conditions and span across multiple entities.

To understand Web Form, let us create a simple Employee Exit Survey having 3 questions and 2 web form steps.

Basically, we have one Web Form which can have one or more than one Web Form Steps. Here we will use tabs within a single form for web form step (we can also use multiple forms as steps)

Let us first create a custom entity named Survey which we will use in Web Form having 2 Tabs Step 1 and Step 2, which we will use to define our Web Form Steps respectively.

Here each field/ attribute defined is one question in our Survey.

Using Web Form Metadata we can specify the label for the fields above and can do some formatting as well.

Below is our Web Form record –

Start Step is where we define the Web Form Step, which are similar to Entity Form.

Below is our First Step Web Form Step.

Type Load Tab – as we are loading the tab here
Target Entity Logical Name new_survery
Next Step Second Step – the next web form step.
Mode Insert – as we are creating the record
Form Name Name of the form
Tab Name Tab inside it

Also here we will create a related Web Form Step Metadata of type attribute to define the label for the field named new_firstquestion.

Let see the definition of the next Web Form Step i.e. Second Step

Mode Edit – Here the mode is edit as the record will already be created in the first step and will be updated in this next step.
Move Previous Permitted Allowing user to move back to the first step.
Next Step Blank – so this will be the last step.
Source Type Result From Previous Step
Entity Source Step First Step – the previous step.

Below is the Web Form Metadata for the below 2 fields of the Step 2 Tab. One of the fields is Option Set and the other is Boolean.

Metadata for second question field –

Metadata for third question field –

Finally, the web page that displays the Web Form

This is how the Web Form renders in the portal

On Submitting the Survey

This creates the Survey record in CRM

Hope it helps..

Clear Cache in Portal in Dynamics 365

Update – Append “/_services/about” to the portal URL ==> OCache

 

Or

Restart the portal from Portal Admin Page

Cache1

Recently while working on web form configuration we made few changes to the form that was being used in web form step. However, the changes we made were not getting reflected back in the portal.

We had added the 2 controls in Step 2 tab in the form, however the change was not getting reflected back in the portal.

In the portal,

To refresh the website with the latest CRM changes, we can go to the Dynamics 365 Administration Center

And change the portal state to off – update and back on – update.

This updates the portal page with the latest changes

Also refer this document

https://community.adxstudio.com/products/adxstudio-portals/documentation/developers-guide/cache/cache-invalidation-utility/

Hope it helps..

1000 posts on my blog

Hope they have been helpful 🙂

1000

Understanding Parental Scope in Entity Permission in Portal (Dynamics 365)

Let us create 2 entities Parent Entity and Child
Entity having 1 – n relationship.

Here we will be creating Entity List for Child Entity that displays all the child entity records associated to Parent Entity to which user has access to.

This we can achieve using Child Entity Permission record for the Child Entity.

First let us define an Entity List for Parent Entity to which we will enable Entity Permission with Global Scope.

Next let us create Entity Permission for Parent Entity and assign it to one of the web role associated to the current Portal Contact user.

For simplicity, we are keeping the Scope as Global. We can also use Contact and Account scope here for filtering the access to the records if that Entity is associated with the Contact Entity. Based on which the Child entity records will further get filtered.

https://nishantrana.me/2017/02/28/understanding-scope-global-contact-and-account-in-entity-permission-in-portal-dynamics-365/

The above Entity Permission gives access to all the records (Global – Read) of Parent Entity to the portal user.

Now let us create an Entity List for Child Entity and enable Entity Permissions.

Configure the below Actions Create, Details, Edit and Delete.

To configure the above Actions we would need an Entity Form, so before we do that we need to create an Entity Form for Child Entity.

Next configure a web page to display the Child Entity Entity List.

Now comes the important part i.e. creating child entity permission for Child Entity.

Create an Entity Permission Record with the below details :

Scope – Parent

Parent Entity Permission – Entity Permission created for Parent Entity i.e. Entity Permission Parent Entity.

Parent Relationship – the 1 – n relationship we created between Parent Entity and Child Entity.

Now opening the page which has the Entity List defined for Child Entity, we can see the below 3 records associated to the parent records to which user has the Read access.

We do not see the all the records as not all the child entity records are associated to the parent entity’s record.

Hope it helps..