JavaScript to Copy a MultiSelect Option Set Choices field

Microsoft Dynamics 365 allows a table column (field) type that supports selection of multiple option values (choices). This is a very good field format type to setup vs creating custom “one to many” or “many to many” table for storing multiple values associated with a record. An example would be an Account record with the various types of wine it carries such as Cabernet Sauvignon, Pinot Noir, Merlot, etc. (I’m working in the luxury brand winery CRM these days so this example readily comes to mind…)

At present, Multi-Select Choices field are not supported via Business Rules or legacy Workflows (The good news is that Power Automate Flows could access and update multi-selection picklist option sets in async mode). So if we need some custom logic via the Front End User Interface – what should we do?

We will have to use Power Apps Client Side JavaScript since legacy Microsoft CRM’s Real Time Workflow is not even an option.

Below is a simple JavaScript example of accessing and copying a Multi-Select Choices field value to another Choices field:

Here are the steps to setup the example:

// jsCRM220501.copyChoices01
var jsCRM220501 = window.jsCRM220501 || {};
(function () {
  "use strict";
  this.copyChoices01 = function (executionContext) {
    var formContext = executionContext.getFormContext();
    var mpl001Values = formContext.getAttribute("new_choices001").getValue();
    formContext.getAttribute("new_choices002").setValue(mpl001Values)
  }
}).call(jsCRM220501);

Setup two MultiSelect Option Set (Choices) fields on the Account form. Name these two MultiSelect Option Set fields “Choices001” and “Choices002” so that it matches the sample code field name references above. Otherwise be sure to match the field names by updating the “new_choices001” and “new_choices002” appropriately.

Setup a JavaScript Web Resource (it is better to use the Classic Solution Designer for this at this time)

Click on the Text Editor button on the left of the Type field and insert the JavaScript code above

Save and Publish this Web Resource

Set the Account Form Onload Event to call this Web Resource (Onload Event is use for this example – could be setup for other events such as field update or record save event)

Save the Form and Publish the Form. That’s it for this simple Multi Choices JavaScript copy example.

Here is a Multi Choices JavaScript example to show a hidden form field if one of the multi selected option set value is 10000001:

var jsCRM220501 = window.jsCRM220501 || {};
(function () {
  "use strict";
  this.displayField = function (executionContext, fieldname) {
    var formContext = executionContext.getFormContext();
    var mpl001Values = formContext.getAttribute("new_choices001").getValue();
    if (mpl001Values) {
      // check if one of the value selected is 100000001
      if (mpl001Values.includes(100000001)) {
        // hide the new_textfield001 field on crm form if 100000001 is selected 
        formContext.getControl("new_textfield001").setVisible(true);
      }
    } 
  }
}).call(jsCRM220501);

Here is a Multi Choices JavaScript example to remove a selected (de-select) value 10000002:

// jsCRM220501.copyChoices01
var jsCRM220501 = window.jsCRM220501 || {};
(function () {
  "use strict";
  this.copyChoices01 = function (executionContext) {
    var formContext = executionContext.getFormContext();
    var mpl001Values = formContext.getAttribute("new_choices001").getValue();
    // deselect value 100000002 before copy to another multi-select picklist
    mpl001Values = mpl001Values.filter(function(e) { return e !== 100000002 })
    formContext.getAttribute("new_choices002").setValue(mpl001Values)
  }
}).call(jsCRM220501);

Contact me if you need some Microsoft Dynamics 365 / Power Apps / CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Dynamics 365 | Tagged , , , , , | Leave a comment

Embed Canvas App on Model-Driven Form Security Role and Sharing Settings

Per the Microsoft Power Apps Share an embedded canvas app article – need to share the embedded canvas app with Everyone in your organization, a security group and/or specific users.

Here is an example screen shot showing sharing the app with Everyone, a Microsoft 365 security group, and a specific user. Note: If sharing with Everyone – then NO need to share with specific users.

Ensure the users have appropriate permissions for any Microsoft Dataverse tables (entities) that the embedded canvas app uses – this means checking the usual Dynamics 365 / Power Apps Security Roles and assigning them properly. In-addition, ensure at least one of the assigned Dynamics 365 / Power Apps Security Role has read permissions (full green circle) for the “Canvas App” table under the “Customization” tab and the “CanvasApp Extended Metadata” table under the “Custom Entities” tab


Contact me
 if you need some Microsoft Dynamics 365 / Power Apps / CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Dynamics 365 | Tagged , , , , | 1 Comment

Microsoft Dynamics 365 Mobile Options – Power Apps Mobile / Dynamics 365 for phones and tablets / Dynamics 365 Sales app

Here are the Microsoft Dynamics 365 / CRM Mobile App options available to run on the iPhone/iPad and Android:

Jump to the Summary Review and which Microsoft CRM Mobile App to start with.


Dynamics 365 for phones and tablets


Dynamics 365 Sales mobile


Power Apps Mobile

Note from Power App Mobile: Customer engagement apps (such as Dynamics 365 Sales and Dynamics 365 Customer Service) don’t run in Power Apps mobile. Instead, you use the Dynamics 365 for phones and tablets apps.

However – it should work OK per this Microsoft Documentation. It just launches the Dynamics 365 for phones and tablets App with a few minor differences that I’d observed – icons on the main apps list are different and non-production apps selection. Power Apps mobile allows users to pin the Microsoft CRM App on to their phone’s home screen

To set the “Show non-production apps” in Power App Mobile: need to go to Settings. This is important to note if you are running a Dynamics 365 Trial Environment – since Trial Environments are considered non-production apps.

Show non-production apps” is not enabled by default – when you initially open Power Apps Mobile you may see “You currently have no apps” under the “All apps” view.


Microsoft Outlook for iOS and Android – Dynamics 365 Add-in

There is actually a fourth Dynamics 365 Mobile app choice – the Microsoft Outlook for iOS and Android with Dynamics 365 Add-in. It is currently the only mobile choice to track an email from the Outlook inbox to Dynamics 365 and have access to Dynamics 365 data. This is the SAME Dynamics 365 App for Outlook setup used on the Microsoft Outlook on the desktop and web – just on the mobile. There are some features not supported on the mobile for Android or iOS vs desktop/web as documented here such as tracking Outlook meeting appointments.

Here is the link to my earlier blog on this option.


Review Summary

So which Dynamics 365 Mobile Apps should you choose? Power Apps Mobile / Dynamics 365 for phones and tablets / Dynamics 365 Sales app / Microsoft Outlook for iOS and Android with Dynamics 365 Add-in

Between the Dynamics 365 for phones and Dynamics 365 Sales app – the Dynamics 365 Sales app is newer, optimize for Salespeople and has Exchange Online calendar appointment integration – so start with the Dynamics 365 Sales app and test if it is sufficient for your company. Per Microsoft Dynamics 365 Sales mobile app Overview: It is recommended for all Dynamics 365 Sales users who are using the Dynamics 365 for phones and tablets app to migrate and start using the Dynamics 365 Sales app instead. Here is a link to the difference between Dynamics 365 Sales app and Dynamics 365 for phones and tablets app

If your CRM users are already familiar with the Microsoft Outlook for iOS and Android App – then start with Microsoft Outlook for iOS and Android with Dynamics 365 Add-in (supports the Outlook Email Inbox / Sent folders tracking) and go from there

Now, if your organization is using Power Apps mobile, both canvas and model driven apps – then start with Power Apps mobile and go from there.

By the way, your CRM users don’t have to be limited to one Dynamics 365 Mobile App. Maybe deploy two Dynamics 365 Mobile Apps if that makes sense. For me personally – I’d start with the Outlook Mobile App with Dynamics 365 Add-in AND Dynamics 365 Sales mobile app. This way, I get to track/set regarding my Outlook/Exchange Emails and also my Appointments.

As always, with any Microsoft Dynamics CRM deployment – proper planning, setup, testing, user readiness and support are keys to success.


Contact me
 if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Dynamics 365, Mobile App | Tagged , , , , , , , , , , , , , | 1 Comment

How to: Set up a word template in Word 365

Thanks. Good how to write up.

Reina's Teenage Dynamics 365 Learnings

This process does take multiple steps and it is important not to get them mixed up nor skip a few steps. However, when mastered, creating standardized documents will be much easier using templates!

There will be a video tutorial at the bottom of this post.

1: Have/Create a word template

For this demo, I will use this Interview Thank You template already prepared prior to this process.

Next, you need actual information to put into those areas (name, address, number, etc.) Let’s use some sample contacts for this demo.

1. go to Settings in Dynamics 365 >> Advanced Settings >> click the dropdown next to Settings >> under Business click on Templates >> Document Templates >> + NEW >> select Word Template >> choose Contact (or whatever entity for the template) >> Select Entity

2. You’ll be asked to select certain items pertaining to the relationships. If you have other…

View original post 277 more words

Posted in Dynamics 365 | Leave a comment

How to: Set Up Dynamics 365 Trial

Thanks for the latest Trial Setup steps!!!

Reina's Teenage Dynamics 365 Learnings

Beginning a trial in Dynamics 365 is useful for learning, demos and testing out operations and applications before committing to the platform!

1. go to https://trials.dynamics.com/ >> click on Try for free.

2. Without inputting an email, click on the blue button: Start your free trial >> Then it’ll let you set up a new trial account

.

3. Click on Create a new account

4. Input the email you would like to use for the trial (you can use your personal or work email here)

5. click on Create new account

6. Fill in the information for part 2

7. Receive the verification code and you’re set for the trial!

Next, here are the steps to set up a trial platform within your new account

1. Once the Power Platform admin center loads, select the + New button in the top left. Name your trial to whatever you’d…

View original post 114 more words

Posted in Dynamics 365 | Leave a comment

How To: remove a left menu item in Dynamics 365

Nice write up on using the app designer!

Reina's Teenage Dynamics 365 Learnings

This is to edit the left hand side menu by removing a certain item that isn’t needed within the Dynamics 365 app. For the steps, I will show it through the Sales Hub and will be removing “Quick Campaigns” from the Marketing section.

There will be a video tutorial at the bottom of this post.

  1. On whatever Dynamics 365 app you’re on, click on the settings icon on the top right and select Advanced Settings

2. Click on the drop down next to “Settings”, select Apps

3. It will bring you to a page that includes all of your apps. Select the app for which menu you need to edit. Click the three dots and select Open in App Designer

4. Click on the edit “pencil” button next to Site Map.

5. Select the certain item to remove, then click the Delete button on the top left.

View original post 49 more words

Posted in Dynamics 365 | Leave a comment

Cannot Delete Business Process Flow Due to Component Dependencies

Encountered the following error when trying to delete a Microsoft Dynamics 365 Business Process Flow (BPF)

Cannot Delete Component.  Cannot delete Process because one or more components require it.  More information on the dependencies can be found here: Details

Clicking on the Details opens up the Dependent Components Detected windows. BUT it is empty.

Download Log File – does not specify the details either.

System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.Crm.CrmException: The Entity(15c84b70-23cf-eb11-bacc-000d3a57368e) component cannot be deleted because it is referenced by 2 other components. For a list of referenced components, use the RetrieveDependenciesForDeleteRequest.
   at Microsoft.Crm.Dialogs.DeleteDialogPage.ProcessCrmException(CrmException crmEx) +0x169
   at Microsoft.Crm.Dialogs.DeleteDialogPage.ConfigureForm() +0x907
   at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e) +0x75
   at Microsoft.Crm.Application.Controls.AppPage.OnPreRender(EventArgs e) +0x7
   at System.Web.UI.Control.PreRenderRecursiveInternal() +0x54
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +0x6d3
   --- End of inner exception stack trace ---
   at System.Web.UI.Page.HandleError(Exception e) +0x11b
   at System.Web.UI.Page.ProcessRequestMain(Boolean inc... (Fault Detail is equal to Exception details: 
ErrorCode: 0x80040216
Message: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.Crm.CrmException: The Entity(15c84b70-23cf-eb11-bacc-000d3a57368e) component cannot be deleted because it is referenced by 2 other components. For a list of referenced components, use the RetrieveDependenciesForDeleteRequest.
   at Microsoft.Crm.Dialogs.DeleteDialogPage.ProcessCrmException(CrmException crmEx) +0x169
   at Microsoft.Crm.Dialogs.DeleteDialogPage.ConfigureForm() +0x907
   at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e) +0x75
   at Microsoft.Crm.Application.Controls.AppPage.OnPreRender(EventArgs e) +0x7
   at System.Web.UI.Control.PreRenderRecursiveInternal() +0x54
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +0x6d3
   --- End of inner exception stack trace ---
   at System.Web.UI.Page.HandleError(Exception e) +0x11b
  ...).

Each Business Process Flow creates a corresponding table (called entity previously). This table could be referenced as a dependent component. Open this table that was created when a new BPF is activated the first time – click on the BPF Name (this is the table that was created)

Click on “Show Dependencies”

Noticed that this table was reference in a Model driven app. Note: OK to ignore the EntityRelatonship component types and the actual BPF.

For this example – click on the CRM Hub Model-driven app and remove the BPF entity from the app

Be sure to save and then publish. The BPF can now be deleted.

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Dynamics 365 | Tagged , , | Leave a comment

Classic Solution Explorer Capabilities NOT yet available in Power Apps New Designer

Microsoft Power Apps Designer helps create Model Driven apps. However, there are capabilities in the Dynamics 365 Legacy / Classic Solution Explorer that are NOT yet available in the Microsoft Power Apps New Designer. Until then – use the Classic Solution Explorer to perform app making and customization tasks that can’t be completed from the Power Apps home page. Here are some Classic Solution Explorer capabilities NOT yet in Power Apps New Designer.

Relationship Behavior – Configurable Cascading

As of 5/25/2021. Dynamics 365 Legacy / Classic Solution Explorer supports modifying the Relationship Behavior of 1:N Relationship settings – such as setting the Type of Behavior from the default “Parental” to “Configurable Cascading“, Assign behavior to “Cascade None” instead of the default “Cascade All

Classic Solution Explorer
New Designer – unable to modify the Type of behavior

Form Navigation Area Editing

As of 5/25/2021. Dynamics 365 Legacy / Classic Solution Explorer supports form navigation area editing. Located on the left side of the classic form designer, use the navigation area to control access to related entities or to add links to URLs to be displayed in the main pane of the form. To edit navigation, you must first select the Navigation command in the Select group of the Home tab. No such editing option in the new Designer.

Classic Solution Explorer

As of 5/25/2021. Dynamics 365 Legacy / Classic Solution Explorer supports Navigation Pane Item Custom Label. This allows for the editing of the Related Table (1:N Relationship) display label different than the table name.

Classic Solution Explorer
Custom Label display under Unified Interface App

Real-Time Workflows / Legacy Workflows / Business Process Flows

As of 5/31/2021. Dynamics 365 Legacy / Classic Solution Explorer supports the creations of Real-Time Workflows or Legacy Workflows. It also supports the creations of Business Process Flows (BPF). The Microsoft Power Apps New Solution Designer under the “Process” type can display Real-Time Workflows, Legacy Workflows and BPFs, however there is no option to create them. Need to Switch to classic to do this at this time.

New Solution Designer has NO option to create NEW Real-Time Workflows / Legacy Workflows / BPFs
Classic Solution Explorer New button allows creation of Workflows and BPFs

Activity Type Party List Field

As of 6/15/2021. Dynamics 365 Legacy / Classic Solution Explorer displays Party List type in Table (Entity) Columns (Fields). The only supported option to setup a new Party List field is via a Custom Activity Type table (entity) – and re-purpose the existing 11 Party List fields such as To, CC, Customers, etc.

Classic Solution Explorer displays Party List type

Reference Panel

As of 6/21/2021. Dynamics 365 Legacy / Classic Solution Explorer Form Designer supports the Reference Panel section option. A reference panel is a single column section. You can insert sub-grids, quick view control, or a knowledge base search control inside a reference panel section. Each control that you added in the reference panel appears as a vertical tab within the panel at runtime. This is a good UI option – but for now only able to add it via the Classic Form Designer. Here is a nice write-up on Reference Panels by MVP Dian Taylor

Reference Panel only shows up in the Classic Form Designer Section options
Reference Panel in Out of the Box Case for Interactive experience form

Editable Grids / Editable Sub-Grids / Nested Grids

As of 6/23/2021. With editable grids, users can do rich in-line editing directly from views and sub-grids whether they’re using a web app, tablet, or phone. Dynamics 365 Legacy / Classic Solution Explorer is the only option currently to setup/configure the Editable Grid or Sub-grid/Nested Grid control. Here is a good write-up on Nested Editable Grids by MVP Priyesh Wagh

Editable Grid at the Table (Entity) level available only in Classic Explorer
Editable Grid / Nested grid within the Form’s Sub-Grid available only in Classic Explorer Form Designer
New Form Designer displays Error loading control on the Editable Sub-Grid

As of 7/7/2021. Relevance Search delivers fast and comprehensive search results in a single list, sorted by relevance. Select entities for Relevance Search is only available via Dynamics 365 Legacy / Classic Solution Explorer.

Option Set / Choice field type NOT using existing Option Set

As of 8/29/2021. The field type “Choice” (previously called Option Set) to NOT use an existing Option Set is only available via Dynamics 365 Legacy / Classic Solution Explorer.

It is available on Power Apps Add column – click on View More to display the option of Global Choice (which is same as Yes to using Existing Option Set) or Local Choice (No to using Existing Option Set)

Web Resource / IFrame / Bing Maps Controls

As of 1/25/2022. To insert the Web Resource / IFrame / Bing Maps components / controls to a Form is only available via Dynamics 365 Legacy / Classic Solution Form Designer.

Choice (Option Set) Display Order Change

As of 2/15/2022. Changing the Choice option (Option Set values) display order is only available via Dynamics 365 Legacy / Classic Solution Explorer.

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Dynamics 365 | Tagged , , , , , , , , , , , , , , , , , , , | Leave a comment

Error: Table could not be updated: entitymap With Id Does Not Exist

Doing some configurations on a Microsoft Dynamics 365 CRM environment and received this error while trying to add a NEW Lookup column (previously called field) to a just created NEW custom table (previously called entity) in a Model Driven App:

The table could not be updated: entitymap With Id = xxxxx Does Not Exist.

I was using the Microsoft Power Apps Designer to setup the new table and new columns. I had created an UN-managed Solution that contains the new table and then published the Solution. Then I proceeded to create a new Lookup column and clicked Done. So far so good.

However, when I tried to clicked on the “Save Table” – I received the “The table could not be updated: entitymap With Id = xxxxx Does Not Exist.” error.

Note: new text or date format columns were created OK – no error after clicking “Save Table”

Tried clicking the “Save Table” a few times within a few minutes – still same error.

Searching the internet yield no good ideas. I speculated that because the new custom table was just created – the new table’s meta data has not yet propagated to all the Microsoft’s cloud data locations that the new lookup column creation process is dependent on.

Waited another 10 minutes and tried again. This time worked OK! No support ticket needed.

If someone else encounters this error in the future – resolution may be just to wait a few minutes and try again.

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Dynamics 365, Power Apps, Troubleshooting | Tagged , , , , , , | Leave a comment