How To: Microsoft Dataverse Security

Hello everyone! I hope everyone is having a great first day of the year!

I am very excited to announce that I have finally created a Youtube channel called “Coffee & Technology”. Yes, because these are two of my favorite things. 😀

This channel is dedicated to Dynamics 365 and the Power Platform community. I created this channel to share with you how you can leverage out of the box features of Dynamics 365 and share with you some tips and tricks I learned in the past few years.

In the first episode, I will show you how Dataverse Security can adapt to many business scenarios.

I hope you find this helpful and if it did, please don’t forget to like this video, share and subscribe.

Cheers to new hope, new chance! May we have a wonderful 2022!

PS: If you have any business scenarios you need help on and would like me to do a video of, please feel free to reach out. 🙂

Featured post

Using JavaScript in Dynamics 365 (Client API Reference)

Today, I will share with you some tips and tricks when adding custom scripts in your Dynamics 365 application. Here, I shared some of the common scenarios that may require you to write codes. The following scenarios are just examples; you might encounter different requirements, but the same solutions can be applied, so keep an open mind. I thought a one-page reference would be of good help, especially for those who are just exploring Dynamics 365 customization.

Scenario 1: Run a script on form load but ONLY when creating a new record.

Solution: Get the form type of the record and use it as your condition to ensure that you don’t load ALL scripts on every form load.

Syntax: if (formContext.ui.getFormType() === 1)

ValueForm type
0Undefined
1Create
2Update
3Read Only
4Disabled
6Bulk Edit
Form Type Return Values

Scenario 2: Every time you open a form, it says unsaved changes. This is because your form is dirty which means there are fields in your form that have changed. To find out what these fields are, you can use the developers’ tool available in your browser.

Solution: Press F12 while running Dynamics 365. Run the following script in the console and it will tell you the fields that you need to deal with.

Syntax: Xrm.Page.data.entity.getDataXml()

Scenario 3: You are required to set a value in your scripts which is only intended to control logic in the form. This becomes a dirty field.

Solution. Set submit mode to control how you want to save the field you changed programmatically. If you are not interested to store the value, you can choose to do so by setting the submit mode it as “never”.

Syntax: formContext.getAttribute(attributeName).setSubmitMode(mode);

alwaysThe data is always sent with a save.
neverThe data is never sent with a save. When this is used, the field(s) in the form for this attribute cannot be edited.
dirtyDefault behavior. The data is sent with the save when it has changed.
Submit Modes

Scenario 4: You are required to manipulate a lookup field value in the client side.

Syntax: (see image below)

Setting a value to Email Regarding field

Scenario 5: There are cases when users want to enable auto-save for most forms but disable it for specific forms.

Solution: Get save mode

Syntax: executionContext.getEventArgs().getSaveMode()

ValueSave modeEntity
1SaveAll
2Save and CloseAll
5DeactivateAll
6ReactivateAll
7SendEmail
15DisqualifyLead
16QualifyLead
47AssignUser or Team owned entities
58Save as CompletedActivities
59Save and NewAll
70Auto SaveAll
Save Mode Values

Scenario 6: Hiding and showing UCI tabs. Depending on the users, they can be very particular on working on form tabs.

Syntax: _formContext.ui.tabs.get(tabName).setVisible(false);

Scenario 7: Manipulate UCI tab label and set it as the active tab (focus) on form load.

Syntax: formContext.ui.tabs.get(tabName).setLabel(“Details”); formContext.ui.tabs.get(tabName).setFocus();

Scenario 8: Need to pass a parameter when a certain field value has been changed.

Solution: Add the script file in the form properties and define the JS function in the onchange event of the field. Enable pass execution context as the first parameter.

OnChange Field Properties

Syntax: functionName = function (executionContext) { var formContext = executionContext.getFormContext(); }

Scenario 9: You are required to display a notification message on the form.

Solution: Use form level notifications.

Syntax:

_formContext.ui.setFormNotification("INFO", "INFO");
_formContext.ui.setFormNotification("WARNING", "WARNING");
_formContext.ui.setFormNotification("ERROR", "ERROR");

Scenario 10: You are required to display the field values from another entity or table.

Solution: Instead of re-creating those fields in the same entity create a Quick View Form. Another way is to create calculated fields to feed the field value of another entity.

I hope this helps.

For more information on Client API, here is complete documentation for your reference.

If you would like to connect and ask some more tips, feel free to connect with me at LinkedIn.

Featured post

Get Started with Dynamics 365 Field Service with Demo Data

Looking to kick off Dynamics 365 Field Service trial environment with demo data? Well, you’re in the right place.

Make sure you have a valid email address and phone number. It does not have to be a work email. You can use an outlook account like what I did in this demo. Then, go to Dynamics Trial, select Field Service and click on Sign up here.

Once it’s up, you can start preparing the demo data installation.

There are a bunch of things you need to pre-configure before you can install the Fabrikam Manufacturing Demo Data.

  1. Download the demo data and unpack. For US consumers, you basically just need to follow the steps on this link. For non-US consumers, you may have to encounter some other issues like date format, etc.

2. Create and configure users in Office 365. Make sure you assign Dynamics 365 license for each of them so their names will appear in Dynamics 365 Users list (Settings > Security > Users). Keep notes of the username you set for each of them as these are important for the configuration later on.

3. Once it appears in Dynamics 365 users list, set System Administrator role to each of them.

4. Go to the extracted Demo Data file (PackageDeployer_FPSDemoData_v3007) you just downloaded and open PkgFolder and then find and open ImportUserMapFile.xml. Now, paste the email address you created for each user in Office 365. Also, set the DefaultUserToMapTo= field to the email address of the Spencer Low user.

5. In the same folder (PkgFolder), find and open DemoDataPreImportConfig.xml and find the <userstocreateandconfigure> tag. Update the <login> tag with the username (case-sensitive) you set for each user from step 2.

6. Setup a work hour template for Spencer Low. Navigate to Settings > Security > Users, find/open “Spencer Low” user.

While in the user form, navigate on the top menu and select Work Hours.

Click on the calendar and select More Actions > Edit. Select Entire recurring weekly schedule from start to end option and ensure the Work hours are set to 8 AM – 5 PM (9 Hours), Monday to Friday and with the Timezone set to Pacific Time (US & Canada). This is needed to ensure that the Project and Schedule board show as expected.

7. Before running the Package Deployer, check the following in Advanced Find to avoid encountering issues during the installation.

  • Confirm that there is no more than one active Organizational Unit record, and then renaming it to Fabrikam US.
  • Confirm that there is no more than one active Work Template record.
  • Confirm that there is no more than one active Project Parameter record, and then renaming that entry to Parameters

Common Issues & Fixes:

  • The pre-import process failed: Organisation should have no more than one active ‘msdyn_organisationalunit’ (fix: step 7)
  • The pre-import process failed: ID for the user with login ‘davids’ not found (fix: step 5)
  • Renaming Default Work Order Template failed with error: ID for User with login ‘davids’ not found (fix: step 6)

Now, you are ready to run PackageDeployer.exe.

Let me know how it goes in the comments down below.

Featured post

Where to start?

Whether you are someone who wants to jump-start your career, or someone who wants to become certified, or an individual who just wants to grow their knowledge through in-depth learning and gain more confidence on Power Platform, Azure or Dynamics 365 on your own pace, here are the best place for you to go and learn.

Microsoft Learn – Microsoft has launched an improved learning portal a few years back and has published great content to help developers, architects, and IT administrators of all backgrounds to help them achieve more. I remember having to work on Azure or Dynamics CRM back in the day and cannot find any site to learn real-world examples to help me out. No worries because you will find a lot of helpful content now as Microsoft is committed to empowering everyone and has given us guided learning on all of their platform products and services that we can learn at our own pace. You can now explore their Learning Path to learn specific modules of your choice.

Udemy – This is my go-to place in learning more about Microsoft products from a different perspective. Tons of content creator shared a very detailed tutorial and excellent content to help you either pass your Microsoft certification or learn tips and tricks from their real-world experiences.

Enjoy learning and continue to inspire. If you know other learning sites and want to help out the community, please feel free to share it in the comments box below. 🙂

Featured post

Power Apps Community Plan has been rebranded as the Power Apps Developer Plan

If you have not heard yet, you can actually have a free development environment to build and test with Power Apps, Power Automate, and Microsoft Dataverse.

In the Microsoft Learn article, it explains that this plan enables you to:

  • Create apps and flows without writing code, with full-featured Power Apps and Power Automate development tools. Easily share and collaborate on these solutions with others.
  • Connect to any data source by using 400+ out of the box connectors or by creating your own custom connectors.
  • Use a fully managed, scalable data platform with Dataverse, including support for common business application actions. Use out-of-the-box common tables or build your own data schema.
  • Export the solutions you create in your developer environment, and publish them on Microsoft AppSource so your customers can test-drive them.

For more information, please check out Microsoft Learn. Enjoy learning!

Improved Custom Recurring Tasks in Dataverse

Hi there! I have been receiving a few emails regarding my previous post about Custom Recurring Tasks. I read my post and realized that there are missing pieces in there. I probably left it like that to invite discussions and questions. Well, after more than a year, here we are and we got a few inquiries on the solution.

I tested the recurring feature of appointments and use that concept to re-create my Recurring Tasks solution.

I used the same UI section but I kind of optimized the Power Automate. Instead of 2 cloud flows, I kept it to one and use SWITCH to separate the daily vs weekly reoccurrence.

Here is how it looks now:

And to save you time, you can explore the solution by downloading it here. Have fun!

WHAT TO DO WHEN D365 DATA IMPORT DOES NOT WORK?

It gets frustrating when you are in a rush and D365 features does not work as expected for some reasons.

I usually try ALL the workaround first before opening a new ticket to Microsoft support. I want to make sure I have tried different ways and gather all useful information that I can share with Microsoft in case I needed to report an issue. This is also the best way to ensure that we can resolve an issue together as quickly as possible. Because, we are a team! Right?

Anyhow, I wanted to share something with you that I have used when Data Import get stuck in submitted status for some reasons. Usually, the first thing you look into is if the CRM environment is in Administration Mode. If YES, then turning it off should fixed the issue.

However, what do you do if its disabled but still getting this issue? (argh!) Open a Microsoft ticket! Right! But here is another thing that you can use.

Look into XRMToolbox. It usually have a lot of useful administration tool that can help and of course, Data Migration Tool. My goal is to import the same data I have in DEV to a UAT environment to ensure that I have the same GUID in all CRM environments. But why the same GUID, I’ll talk more of that some other time.

Data Migration Tool – I have been using this tool for years but did not realize that it has a filtering capability! I might be late on this but here is how you can use it.

When you create a schema and selected the entity you want to import, go to Tools > Configure Import Settings.

Then at the bottom, check User FetchXML to filter records.

Now, you cannot use the whole fetchxml format, you need to remove the output-format and just keep the filtering tags, like this:

Save and you are good to go! I hope this helps and follow me for more tips! Stay safe, everyone!

Rich Text Editor is live #2020wave2

Hey folks! How are you?

I just found out that the free 3rd party rich text editor that we have been using in Dynamics 365 for multiline of text removed its Spell Check feature but guess what???

Dynamics 365 has new Rich Text Editor PCF control and it looks awesome! Check it out!

Recurring Tasks in Dynamics 365 using Power Automate #lesscode

In Dynamics 365, Appointment Activity has recurrence feature. But what if business has a requirement to have the same functionality when using a Task Activity, like specifying a recurring pattern & dates?

Today I will share with you a simple approach on how you can create a custom recurrence feature in Task Activity using the power of Power Automate.

I used Custom Fields, a Workflow & 2 Power Automate Flows. I also used workflow extension from a Dynamics 365 Workflow Hero, Jason Lattimer.

I added a few more custom fields to hold daily & weekly count for doing a loop in Power Automate.

Then I created a Two Option field called “Automate” that I can use on my Trigger Condition.

Daily Recurring

At the end, I make sure I decrement the Count just how we do it when writing codes. Then for weekly recurrence, I used Date Time connector – “Add a Time” and set it to add 1 Week.

And there you have it, a simple & working recurring task feature for your Task Activities.

I hope this is helpful. Let me know if you want to see the whole solution. Feel free to message me and I will send it straight to your mailbox.

Stay safe, everyone.

How to Create a Survey or Quiz Form for your Team? #office365 #microsoftforms

Did you know that there is an easy way to create a survey form or a quiz to send it to your employees or team inside or outside your organization?

Microsoft Forms can be shared in public as long as you don’t use the File Upload type. File Upload type is for internal members of your organization’s use only.

Responses are also available in real-time so you can review the results in no time just as how quickly you created it. Plus, it can be easily integrated with Dynamics 365 using Power Automate. 😉

I created this DEMO QUIZ in minutes showcasing the different types of control you can leverage from it. Feel free to try it and let me know how you feel about it.

If you have Office 365 license, you can try it by going to https://forms.office.com/.

Have fun!

OOB Calendar Control in Activities View #quicktip

Hey Guys! I hope you are all doing well in spite of the virus that is going on. Stay safe and be aware of the situation. Here is a good link for your reference.

For today’s blog, I am introducing #quicktip content to share with you a small feature in Dynamics 365 that deserves some attention. If you are already aware of this then that’s great, if not, I’m happy you found this page.

Our Quick Tip is about the out-of-the-box (OOB) Calendar View that we can use in viewing Activities in Dynamics 365.

Setting the Calendar Control will give your users a calendar view of all their activities marked on due date.

And even if its in calendar view by default, you can always revert it back as list. Check this out.

I hope you find this helpful. Take care eveyone.

Create a website or blog at WordPress.com

Up ↑