Open the xml file using notepad++ or any other text and source code editor that you can get, then follow below steps:
Press Ctrl + A on your keyboard to select the entire script
Press Ctrl + J on your keyboard to change xml to a single string, and then assign it to a variable fetchxml (you can also use other name as long as it meet Naming and declaration rules for variables of JavaScript)
below is a screen shot of the layout from new Unified Interface
Legend
Look for records: Select the textbox and type your search criteria to look for rows.
Recent: Rows that were recently searched (new unified interface)
Note: for the legacy web client, only the first three columns (from left to right) of the related entity Lookup View are displayed.
New Record: Create a new row.
Types of records: Select to filter by a table type such as Contact table or Account table. The number in front of type of records represents how many table are available to filter from.
Browse in a lookup column: To browse a lookup, select the lookup icon (magnifying glass). A full list of items will be shown in the dropdown.
Expand item: the first two columns are shown, and clicking on the dropdown will show all Lookup view columns. Some lookups such as Customer – which can be either Accounts or Contacts – display both to be selected as shown in the above screenshot. For more information on keyboard shortcuts, see Use keyboard shortcuts in Power Apps.
Change View: by clicking on Change View – if the data filter applied to the Lookup View excludes the data being searched for. For example, the Account Lookup view filters on Active Accounts only by default, so selecting another view may be more appropriate. For more information on views, see Use grid filters.
In today’s post, we will use the the out of the box Primary Contact lookup field on the account form as a example,
Different Views that will be involved
Two views of the contact entity will be involved:
Lookup View:
A typical Lookup View of contact entity is shown as below -> the view you will see when select the textbox of the lookup field.
There is one lookup view per entity. Lookup views cannot be deleted or deactivated, but they can be edited. You are unable to create any additional lookup views at the moment.
Quick Find View
A typical Quick Find View of contact entity is shown as below, where you can also setup the Find by property that means based on which fields (columns) the search will be performed -> the view you will see after searching the results in the textbox of the lookup field.
When entering a value into a lookup field and the button or lookup icon is pressed, a search is carried out on the related item’s data using the Find columns defined in the related entity’s Quick Find View
Configure Lookup view for a lookup field on a form
we still use the Primary Contact lookup field on the account form as the example
Go to the solution -> navigate to Account entity -> find the main account form and open the classic form designer -> find the Primary contact field and double click on it to open the Field Properties configuration window.
FILTERED LOOKUPS
Filtered lookups will display a subset of records when looking up to an entity.
For instance, Account entity has an out of the box lookup to Contact entity called ‘Primary Contact’. by default, this lookup is filtered to only show Contacts who have the current record (#2 indicated by below screen shot) as their Parent Account, which means that you can only enter someone as the Primary Contact for an Account if they work at that Account. This makes sense.
Default view in a lookup field
If you’d like to set up the default view in the textbox of a lookup field, when you select it, then you should configure in the Additional Properties section as below screen shot shown. You can switch to another view as well.
When configuring the lookup field on the forms, any other view could be chosen as well.
Additionally, View Selector can be locked and/or limited to user’s own records.
When you create a new lookup field you are creating a new Many-to-One (N:1) entity relationship between the entity you’re working with and the Target Record Type defined for the lookup.
There are additional configuration options for this relationship that are described in Creating and editing entity relationships. But all custom lookups can only allow for a reference to a single record (a single target record type).
However, you should be aware that not every lookup behaves this way. There are several different types of system lookups as shown here.
Customer: Allows for a single reference to either an account or a contact record. These lookups are available for the Opportunity, Case, Quote, Order, and Invoice entities. These entities also have separate Account and Contact lookups that you can use if your customers are always one type. Or you can include both instead of using the Customer lookup.
Owner: Allows for a single reference to either a team or a user record. All team or user-owned entities have one of these.
PartyList: Allows for multiple references to multiple entities. These lookups are found on the Email entity To and Cc fields. They’re also used in the Phone and Appointment entities.
the partylist allow you to select multiple reference shown as below snap shot
Regarding: Allows for a single reference to multiple entities. These lookups are found in the regarding field used in activities.
For some of you that just start using XrmToolBox the 3rd party tool recently, and you may be wondering how to make a connection to one of your Dynamics 365 (CRM) environments as soon as possible, then you can utilize those amazing 3rd party tools in it to improve the efficiency of your learning, development or validation , ect. for your projects.
If that’s the case, you come to right place. Without further ado, let’s get started.
After download the zip file from below link, then you can unzip the zip file to a folder where you think it fits
then after clicking on and open the XrmToolBox tool, you will see below window, then you can hover over to the bottom left corner to Not connected, and create a new connection from there.
Choose a connection method
then there will be a new window popping up, where you can choose which connection method you prefer. if you are new to XrmToolBox, you could just go with "Connection Wizard" option,
General information and options
after clicking on and open the wizard, you will see below window, where you have to use your own organization url to replace the existing value of the Organization url placeholder, then click on Next,
User Credential
you need to enter your Username and Password to the placeholder respectively, then click on Next. After that, the tool will validate your credential.
Enter a name for this connection
you need to input a name that is meaningful for yourself into Name placeholder, and click on Finish button.
it’s done right away. it’s so simple and straightforward, right?
Tip - How to change Default Font style and size for email form in Rich text editor control in Dynamics CRM
Scenario:
Sometimes, we would come across a business requirement to change the default font for email forms or some other forms. Unfortunately, there is no such out of the box feature in Dynamics 365 (CRM) for users to utilize in order to fulfill this requirement at the moment; however, we can still use JavaScript to achieve it. below is how.
First of all, you can refer to below link from Microsoft for the sample code:
There are two types of configurations: the defaultSupportedProps section, and individual configuration settings that provide various functionality.
today, we will use defaultSupportedProps to configure the default font style and size for one of the email forms. Below are the key attributes of rich text editor control that we will update and configure:
font_defaultLabel
fontSize_defaultLabel
stickyStyle
defaultSupportedProps
You can configure all of the CKEditor-supported properties under this property. A few of the commonly used and custom configurations are described below. For complete documentation about CKEditor configurations, see CKEditor.config.
Attribute
Description
Default value
font_defaultLabel
Sets the default label that is displayed in the toolbar for font style. The default is Segoe UI.
"font_defaultLabel": "Segoe UI"
fontSize_defaultLabel
Sets the default label that is displayed in the toolbar for font size. The default is 9.
"fontSize_defaultLabel": "9"
stickyStyle
Sets the actual default font size and style. Additionally, you can include any other CSS properties you'd like to set as part of your default styling. The stickyStyle plugin creates a wrapper around your content using the element specified by "stickyStyles_defaultTag", which is initially configured as "div".
Some of us may have no idea at all for which font we should pick from above code snippet. If that's the case, you may refer to below link for some reference and knowledge about Font definitions.
there is also another workaround to find out the actual default font size and style as shown below:
open the Developer Tools in Edge or chrome browsers, and hover over to those random text, then the Font information will pop up right away, which will give the idea which font you should go with.
How to update the sample code data
Sets the actual default font size and style
Sets the actual default font size and style as below script (for the actual text that you will enter in the text box)
Add the newly created web resource to the Email form through the Rich Text Editor Control
below are the steps:
then, find the control and click on Add,
Next, click the Pencil button to open Custom configuration URL property (make sure that you also select Web, Phone, and Tablet if you want all client apps to have the ability to use rich text in the column),
then, on the Custom configuration URL property page, Select Bind to static value, enter the relative URL to the JavaScript web resource in the box next to SingleLine.URL, and then select OK. The relative URL is located on the web resource definition.
Note:
For example, if you create an HTML page as a web resource named “new_myWebResource.htm”, you could open that page in a browser using a URL like this:
<base URL>/WebResources/new_myWebResource.htm
but when you add it to the Rich text editor control, please make sure you only use the relative URL like this:
/WebResources/new_myWebResource.htm
Select OK to close the Column Properties page.
On the form editor command bar, select Publish.
Note:
the Rich text editor control component can only be added to the main form at the moment. you can't add them to Card form or quick view form etc.
email for interactive experience has to be configured through the legacy interface.
You can also refer to below link for the training material from Microsoft
if you would like to only use this web resource to update certain forms rather than making organization wide changes, then I suggest you to copy the script and make a new web resource, after than, you can refer to below configuration steps in the new Power Apps interface to fulfill the requirement.
for instance, I’d like to add this web resource only to one of the email form, then I just follow below step to add the control to the form component.
In a Microsoft Edge or Google Chrome web browser, run your model-driven app and open a form that has the rich text editor control, such as an account row.
Press F12 on your keyboard to open the Developer Tools from the browser
Select the Console tab, and then select the parent Main.aspx page in the drop-down list box on the command bar, or you can clear console first, then input
> CKEDITOR.config.
then a list of properties will show up after the dot, where you can select the property you’re look for to find out the current setting for the rich text editor configuration.
Sometimes if we look for the logic name of a certain field on a form, we will have to go to advanced setting -> default solution or a certain solution that you already know -> find the entity (table) -> find the field and the corresponding logic name, which is a bit time consuming.
Workaround:
there is actually another quicker way to find out the logic name for the field on the form using the Developer Tool from the browser (Chrome, Edge, etc.). Below is an example from the Chrome Browser.
once you click on to open the Developer Tool, you will see below side pane, where you can click on that same arrow (indicated in #1), after that you will be able to hover over to whatever field on the form that you’re looking for for the logic name, then the corresponding logic name will show up (indicated in #2 with the underscore).
Add Execution Time field to the form for comparison
the workflow called Contact: test workflow is created as below snap shot shown
then, click on Set Properties to assign a dynamics value {Execution Time(Process)} to the newly added field called Execution Time for testing purpose. in order to compare with the timestamp when the contact record is created, I also add Created On field on the Contact form.
Execution Time in workflow
Step #1 Update the workflow by adding below condition to the flow:
If Contact:Created On on or after [ 5 Minutes Before Process-Execution Time], then:
Update the Job Title field on the contact record as Iron Man
Once completing the set up, you can save and activate the workflow.
Step #2 create a new contact record
Go back to the unified interface and navigate to the Contact entity, and create a new contact record and save it. 1 min After the contact record is created, the workflow is triggered.
Step #3 check the Process session history of the workflow
Below graph will give you some rough idea about how the execution time works.
that’s the reason why the workflow is triggered and completed at the same time (sometimes, the workflow may be postponed based on the availability of the server resources).
Timeout in workflow
Local Values: Process -> Timeout -> Equals -> {3 Minutes After Created On} -> Save and Close
You can replicate Dynamics 365 Workflow Timeout wait condition in Power Automate flow as well.
Step #1 Configure the Wait Condition step using Timeout
Updating the existing workflow by adding the Wait Condition step to this flow
then click on (click to configure) to open a new page where we can select Local Values Process -> Timeout -> Equals -> {3 Minutes After Created On} -> Save and Close
There are at least three ways to configure timeout:
Wait for a specific amount of time
Wait until a specific date
Wait for a specific amount of time based on an existing date/time field
in order to validate the wait condition configuration, one more Update Record step is also added to the flow, then assign a static value called "Super man" to Job Title field for verification.
Step #2 Testing & Validation
Create a new contact record, as we can see below in red rectangle, there is one minute delay (or may be even longer delay based on the availability of server resources) between Created on and Execution Time, because the workflow that is used to update the Execution Time field is a background workflow rather than real-time one.
when the contact is created, the workflow is triggered at the same time as well. then the workflow has to wait for 3min, and after 3min, the Job Title field will be updated.
While the ‘Wait conditions’ are useful in case of the timer related tasks which will be achieved with no coding, excessive use of wait conditions has a downside.
Performance:
Each waiting workflow instance carries performance overhead. The more waiting workflow you have, the more server resources will be consumed by the Asynchronous Processing Service.
If you change the logic in your workflow and republish (like update the text of the email sent to your client), it does not change waiting workflow instances. For example, if you change the renewal email frequency to 15 days rather than 30 days, any workflow instances that are waiting will not be updated.
Activity Count & Activity Count Including Process
When designing workflows, it is possible to test the number of activities (open and closed) against a record (only activities that are regarding the record directly are counted).
The count is available under the Local Value – Process.
There are two activity counts – Activity Count and Activity Count Including Process.
Activity Count is a count of all activities (open and closed) excluding ones created by any workflow.
Activity Count including Workflow is a count of all activities (open and closed) regardless of how they were created.
It seems that the values for the activity counts are evaluated when the workflow starts or is paused and resumed or at the end of a wait. So a step like this to get a workflow to do something when an activity is added to a record does not work:
Wait until Process-Activity Count > some integer (or field with an integer)
However, if there is a parallel wait such as
Timeout until 4 hours
The wait branch with the activity count is re-evaluated and if the test on activity count is true the workflow follows that path rather than the timeout path. Most frustrating.