D365 Ce
Introduction: Mailchimp is a leading email marketing campaign tool used by marketers all over the globe. In this blog, we’ll integrate D365 CE(CRM) Marketing List to a Mailchimp Audience. To achieve this, we’ll be using Read More » Integrate D365 CE Marketing List with Mailchimp Audience(List). May 22, 2019 Overview Webhooks are present in Dynamics CE world since version 9.0, end of 2017, but I think that they are not used that much by the people in the community. Why should we start using them? Webhooks is a lightweight HTTP pattern for connecting Web APIs and services with a publish/subscribe model. Microsoft Docs First Continue reading D365 Webhooks – Part 1. To fix an enable/display rule that was installed by a custom managed solution that you created, you must complete the steps listed above for the option labelled 'The enable/display rule is in the unmanaged Active solution' in your separate development organization that has the unmanaged source version of your custom solution used to create your custom managed solution. Attach files to Notes record of Microsoft Dynamics 365 CRM/CE from the D365 CRM Custom Portal Inkey, September 30, 2019 11489 Views. From the D365 CRM portal, it is now very easy to attach files to the Notes record of an entity. In the Additional Settings area of the Entity form, there is a section named “Add Attach File”. D365 Customer Engagement (CE) Security Introduction D365 Customer Engagement applications (formerly known as CRM applications) work together to intuitively manage the complicated web of customer relationship management. They are becoming an increasingly powerful asset as Microsoft continues to roll out new functionality and seamless integrations. Thus, there is a growing need to ensure that.
Someone asked me if Dynamics 365 comes with auto numbering, to which the answer is of course yes. We have auto numbering for cases, invoices, orders etc. but we can also configure a field to be an auto-number field. There is not a lot of configuration you can do when selecting this option, but if you need a simple auto number solution this will definitely do the trick. The person that asked me about this, needed a more robust solution and we sat down and discussed the requirements.
Requirements
Lets call my friend John. John wants to have the system automatically generate account numbers for account records depending on the value selected in the out of the box option set field called ‘Relationship Type’. The relationship type field has various values i.e competitor, consultant, partner, customer, vendor, prospect, etc. John wants the system to automatically generate a 3 letter & 9 digit account number if the account type field equals ‘customer’ or ‘vendor’. The account number’s first three letters depend on the value selected in the account type field. If the value selected is ‘customer’ the prefix should be ‘ACT’, if ‘vendor’ is selected it should be ‘VDR’. Any other values selected in the relationship type field should not result in an account number.
The Complicated Solution
There are several solutions for this requirement like creating a plugin, but I am going to create a solution by using the out of the box tools in Dynamics 365. John wants a 9 digit number following the prefix mentioned above, but I can’t store this entire 9 digit value in one field because the system will add a comma for numbers over 999. (I.E 1,000) I am going to start by creating a custom entity which I am going to call Counter (new_counter). I will break out the 9 digits that we want for the complete account number in 3 fields. The fields that I am going to add to this entity are:
- Customer ID – Single Line of Text
- Account Number 1 – Whole Number (min value 0, max value 1000)
- Account Number 2 – Whole Number (min value 0, max value 1000)
- Account Number 3 – Whole Number (min value 0, max value 1000)
- Vendor ID – Single Line of Text
- Vendor Number 1 – Whole Number (min value 0, max value 1000)
- Vendor Number 2 – Whole Number (min value 0, max value 1000)
- Vendor Number 3 – Whole Number (min value 0, max value 1000)
I am going to create 1 single record for this counter entity and I am going to store the prefix (ACT) for customer relationship types in the Customer ID field. I am going to store the prefix of relationship type vendor (VDR) in the Vendor ID field. Ikea for mac. The Account number 1, 2, and 3 fields is where I will store the numerical parts of the entire account number. The Account/Vendor Number 3 fields will hold the last 3 digits, Account/Vendor Number 2 field will hold the middle three digits and Account/Vendor Number 1 field will store the first three digits. Each of these fields will store values up to 999 and not any higher, because as soon as we store a number above 999 the system will add a comma and show 1,000 which is not going to look good as an account number. The entire account number that will be entered in the account number field on the account record will be 3 letters and 9 numbers: I.E ACT-000000001 or VDR-000000001. Below is an image of how the account number for a vendor account will be created and then stored in the account number field of the account record in Dynamics 365.
Create Counter Record
Create the counter record and put the following values in each field:
Customer ID: ACT
Account Number 1 & 2: 0
Account Number 3: 1
Vendor ID: VDR
Vendor Number 1, 2: 0
Vendor Number 3: 1
I also need to create a lookup field to the newly created (counter) entity on the account entity so that I can use a real-time workflow to get the complete account/vendor number from the counter record (I.E Vendor ID+Vendor#1+Vendor#2+Vendor#3) and put it in the account number field on the account record.
After the account/vendor number is copied to the account number field on the account record, I need the work flow to increment the number on the counter record with 1. In the above example in the picture, if we have an account number of VDR-001235561 adding 1 would result in the next unique account number to be VDR-001235562. Since the last three digits of the account# are stored in the vendor #3 field, this is the field we would want to increment. If the account number would be VDR-001-235-999, the next account number would need to be VDR-001-236-000, which means we would need to set the vendor #3 field to 0, and we would need to increment the vendor #2 field with 1. Confused yet? I haven’t even talked about the fact that Dynamics 365 stores values from 0-9 as one number (and we would need 2 leading zero’s first (I.E 001). For values between 10-99 we would need 1 leading zero, and anything above 99 wouldn’t need any leading zero’s. These are all things we have to think about when we build our work flows.
The Workflows
As mentioned before this needs to be a real-time workflow for this to function properly. The entity we’re creating this workflow for is the account entity and the trigger is the relationship type field and new record creation. I’m going to call this workflow ‘Account Number Main Workflow’ which triggers on the ‘relationship type’ field. I’ll have a check condition and a start child workflow step based on the value in that field. I.E if the relationship type field=’Vendor’ it’ll launch the ‘auto number vendor workflow’, if the relationship type=’Customer’ it’ll launch the ‘auto number customer workflow’. In order to launch the child workflows we’ll need to create them first. Another option to do this without child workflows, would would be creating one workflow with these conditions (if relationship type=’Vendor” and if relationship type=’Customer’, however this will be a lot more work, and probably harder to troubleshoot. The option I am suggesting will be faster as I have the ability to ‘copy’ a child workflow once one of them is created, by activating it as a process template. Another condition we might want to put in the workflow is to check the account number field on the account record; if it has an account number, we’re not going to run any of the child workflows and replace the account number.
Autonumber Vendor Account Workflow – Child Workflow
This workflow is also a real-time workflow for the account entity. We will check the box next to ‘As a child process’ so we can launch this workflow from the ‘auto number main workflow’ mentioned above. Check the box ‘As a child process’ and don’t check any of the boxes under scope. We want to execute this workflow as ‘the owner of the workflow’.
The first step will be an update to the account record, where I am populating the counter lookup field on the account record with the counter record we created earlier. The next step is where we will start populating the last 3 digits of the account number. We will first need to check the counter record to see if the number in the vendor #3 field=1,000. If this is the case we need to set this vendor #3 field back to 0, and we need to set the vendor #2 field to 1. NOTE: We don’t want the fields to ever have a value of 1,000 or more as D365 adds a comma to the number, this wouldn’t look good in the account number field. See below illustration.
The next couple of steps will be checking to see if we need to put one or two leading zeros in front of the value of vendor #3 before we add it to the account number field on the account. We’ll create check conditions for both of these:
- If the value in the vendor #3 field is 0-9 that means we’ll need two leading zeros. (I.E. 009)
- YES: Update: Set Account number field on Account to 00
- If the value in the vendor #3 field is 10-99 that means we’ll need one leading zeros. (I.E. 099):
- YES: Update: Set Account number field on Account to 0
Note: If the value in the vendor number 3 is equal to or between 100-999 we’ll need no leading zeros. (I.E. 100)
The next step in the workflow is to update the account number field on the account record. First we will enter the dynamic value of the account number field (the leading zeros), then we’ll add the dynamic values of the vendor #3 field next to it.
Tv for mac air. We just created the last three digits of the account number so for the next time this workflow runs, we need to increment the vendor #3 field with a value of 1. (Otherwise it would be the same account number the next time this workflow runs.)
For the second part (thousands) / middle part of the account number we need to do similar steps:
- Check if the vendor #2 field=1,000, if that is the case we need to increment the vendor #1 field on the counter with 1 and we need to reset the vendor #2 field back to 0
- If the value in the vendor #2 field contains one digit (0-9) that means we’ll need two leading zeros. (I.E. 009)
- YES: Update: Account number field on Account: Type 00, Dynamic Value of Vendor #2 Field and Dynamic Value of Account Number Field (This will bring in the values we set in the previous step when creating the last 3 digits of the account number)
- If the value in the vendor #2 field contains 2 digits (10-99) that means we’ll need one leading zero. (I.E. 099):
- YES: Update Account number field on Account to 0, Dynamic Value of Vendor #2 Field and Dynamic Value of Account Number Field (This will bring in the values we set in the previous step when creating the last 3 digits of the account number)
- If the value in the vendor #2 field contains 3 digits (100-999):
- YES: Update Account number field on Account: Dynamic Value of Vendor #2 Field and Dynamic Value of Account Number Field (This will bring in the values we set in the previous step when creating the last 3 digits of the account number)
For the last part of the workflow we’ll set the first three digits of the account number. Here are the steps:
- Check if the vendor #1 field=1,000
NOTE: Since we have a total of 9 digits, hitting 1,000 in the vendor #1 field means we are at the last available number: 1,000,000,000. Before we hit 1,000 we might want to add a step here that sends an email at 999. This email will let someone know we’re getting close to the end of our auto number sequence and that we might need to update the first prefix in the Vendor ID field so we can continue to create unique id’s.
If the number in Vendor #1=1,000 we need to reset the vendor #1 and #2 field back to 0, and the vendor #1 field back to 1 (or 0). (We could potentially set the Vendor ID field to a different prefix and then send out the email mentioned above, but I would probably do it sooner) - If the value in the vendor #1 field is one digit (0-9) that means we’ll need two leading zeros. (I.E. 009)
- YES: Update: Since this is the first part of the account number, we will first add the dynamic value of the Vendor ID field, then we type the two leading zeros (00), then we add the Dynamic Value of Vendor #1 Field and then we add the Dynamic Value of the Account Number Field (which currently holds the last 6 digits of the account number)
- If the value in the vendor #1 field is 2 digits (10-99) that means we’ll need one leading zero. (I.E. 099):
- YES: Update: We will first add the dynamic value of the Vendor ID field, then we add one leading zero by typing in 0, then we add the Dynamic Value of the Vendor #1 Field and then the Dynamic Value of Account Number Field (which currently holds the last 6 digits of the account number)
- If the value in the vendor #1 field is three digits (100-999) that means we’ll need no leading zeros.
- YES: Update: We will start with the dynamic value of the Vendor ID field, then we add the Dynamic Value of the Vendor #1 Field and lastly we add the Dynamic Value of Account Number Field (which currently holds the last 6 digits of the account number)
I understand this might have been a bit complicated so if you want to download a copy of this solution to import it into your own sandbox environment and review, I have posted a link below. Keep in mind that the workflow is pointing at a unique counter record, so you’ll have to import that record after you import the solution. Both the solution file, counter csv file and instructions can be downloaded here. Please note this solution is for learning purposes only! It hasn’t been fully tested for production use!
Update: I was informed that the above solution will not work as multiple creates has a chance of creating duplicate account numbers. I added a simpler solution below.
The Simpler Solution
Since we have the ability to create auto number fields today, we can create a much simpler solution that doesn’t require us to write a 3 foot long workflow. All we would need to do is create a new field that we would configure to be an auto number field which we would not put on the account form. You can read the article on how to do that here. Then we would create a workflow that would copy the values from the auto number field to the account number field if the relationship type field=customer or vendor. We could even add the prefix of ACCT (for customer) and VDR(for vendor).
I hope you enjoyed this post! Be sure to check in again next week for a new topic or subscribe here to never miss another post!
D365 Centralized Payments
Prove that you understand Microsoft Dynamics 365; artificial intelligence; mixed reality; the Power Platform; cloud concepts; cloud security; Dynamics 365 security; Common Data Service; Dynamics 365 reporting; Dynamics 365 integrations; and cloud deployment.
D365 Certification Finance
Because this certification is retiring on June 30, 2021, Microsoft will not be updating references of “Common Data Service” to “Microsoft Dataverse.”