Latest Microsoft Dynamics 365 Blogs | CloudFronts - Page 3

Map Newly Registered Portal Contacts to Existing CRM Contacts in Power Apps portal (Azure AD)

Power Apps Portal allows us multiple ways to authenticate users, users can login either by using a User ID and Password for local login or using SSO logins like Azure AD, etc.  Users can also register themself through the portal, when a user registers from the portal this creates a new contact with the user’s details and email ID in CRM.  But what if the contact already exists in your system? To map the registered portal user with this existing contact instead of creating a new contact we need to enable/add a site setting.  Site Setting –  Authentication/[Protocol]/[Provider]/AllowContactMappingWithEmail  More on Protocol & Provider – https://learn.microsoft.com/en-us/power-apps/maker/portals/configure/configure-portal-authentication  For Azure AD login which is provided by default, you can use the Site Setting – Authentication/OpenIdConnect/AzureAD/AllowContactMappingWithEmail  Reference Microsoft Document – https://learn.microsoft.com/en-us/power-apps/maker/portals/configure/configure-site-settings#portal-site-settings  I hope this helps 😉 ! 

Share Story :

Filtering Entity Lookups based on field value

Posted On March 10, 2022 by Vidit Gholam Posted in Tagged in

I have a contact record with a role option set field with options Billing, Decision Maker, Client, Influencer.  The Requirement is to only show billing contacts i.e. contacts with role billing related to the account selected on the Opportunity in the lookup of the contacts on the Opportunities.  Let’s see how I to filtered the contacts lookup to just show billing contacts :   Step 1:  Create a contacts view such that the role is billing(or any field on which you want to filter is set to the value by which you want to filter that record ).  Step 2:  Set the filter criteria of the contacts lookup field on the opportunity as shown below.  In the Additional properties  turn of the view selector and set the default view to the view you created in #1Step 1  In the Field Behavior Tick the “disable most recently used items for this field”.  Now you will only see contacts with role billing in the lookup of the contacts on the opportunity form.  Hope this helps!   Thank you. 

Share Story :

Dynamically storing MS Forms Drop down field values into D365 CRM Option Set using Power Automate Flow

MS Forms offers a functionality to create a dropdown field which is similar to an option set fields in D365 CRM, But when it comes to mapping or storing values between these two field things become a bit tricky. However there are a few workaround using power automate capabilities. In this blog let’s see how we can store a MS Forms Dropdowns options into an Option Set field in CRM.  What is an Option Set? Option sets are a field type that can be created within Dynamics CRM and are Often referred to as “dropdown” or a “pick-list”.   An option set has two identities for each of its option. The Options Label Name and the Label Value as shown in the below snapshot.  What is a Dropdown in MS Form ? A dropdown is a list of defined options(Choice) that can be selected by a user, unlike a text field where the data can be “organic” or manually entered.  Now Let’s Consider an use case :  Consider we have a MS Form Name “Company Registrations” when a user submits this form a Power Automate flow is triggered which creates a new Account record in CRM with the field mapping shown in similar colors in the below snapshot.   Now we need to get the form responses first to create a new Account record.  2. All the Text field values can be directly mapped into the dataverse connector as shown in the below snapshot.  3. For mapping the MS forms Dropdown to the Option set we need to maintain the CRMs Option Label values into our flow as to set (define the value of the option set) Option Sets in CRM we need to pass the Label Values to the flow (if you just pass the label text it won’t work hence we need to maintain these option set values in the flow)as shown below.  4. Now we need to select the option set field in our flow connector and select enter custom value.  5. Once you are able to add a customer value use the following expression which will dynamically bring option set label value for the dropdown choice selected by the user on the form.Expression – outputs(‘Option_Set_Values’)?[outputs(‘Get_Form_Response’)?[‘body/rf98dd4fb83624fc7b7314de77542a3ef’]]Red : Text in the above expression corresponds to “Outputs “in the below snapshot which is the output of the compose in which we stored our option set label values. Blue : Text corresponds to the “Ownership Type” from the form response.   Output : MS Form Submission –   Created Account Output –   Hope this helps !  

Share Story :

Get Time in Hours and Minutes from a Date Field in CRM using JavaScript.

D365 gives a functionality to create a Date and Time field where in you can provide the user to select the date or both date and time. But what if you just need the time in Hour and Minutes format from the selected date in the Date field, This can be achieved using a JavaScript. In this blog lets see how we can get the time entered in the date and time field and format it in hours and minutes format. I have created a field in CRM with field type Date and time. Here is how it looks Using the JavaScript “Date” functions you can get the Time entered in the date and time field as shown below. This code gets the date and time (hours and minutes) selected in the date field and will format the hour and minutes in the format “HH:MM“. Hour – (getHour()) Minutes – (getMinutes()) Output – Note : You can also add the AM / PM to the time string I have not added it in my time string “strTime” but have stored the value of it in “ampm“. Hope this helps !

Share Story :

Get Month | Day | Year from a Date field in CRM using JavaScript.

D365 gives a functionality to create a Date and Time field where in you can provide the user to select the date or both date and time. But what if you need just the month from the selected date in the date field or say the date or year from the selected date in the date field, This can be achieved using a JavaScript. In this blog lets see how we can split or get the Month | Day | Year from a selected date in the CRM Date and time type field. I have created a field in CRM with field type Date and time. Here is how it looks Using the JavaScript “Date” functions you can get the Month | Day | Year and Time of the entered date as shown in the below script. This code gets the date selected in the date field and splits the date into Month – (getMonth()) Note : January – December is (0-11) hence add 1 so make it (1-12). Day – (getDate()) Year – (getFullYear()) This code gives the month date and date in 2 digit format i.e. if the date is a single digit say 9 it will give it as 09. You can further use this according to your requirement either to change the date format or for many other date related customizations. Hope this helps !

Share Story :

Change Business Process Flow Based on Form Type Using Java Script.

There are situations where you might need different business process flows based on the form type you choose let us take an example. Consider you want a Business Process flow on the lead entity Such that Lead form will show –BPF with stage Discover, Demo, Propose Sales Lead form will show – BPF with stage Discover, Requirement Gathering, Qualify The case be achieved by doing the following. Lets begin with the implementation. Solution – Step 1: Make a Solution for your customizations and add the lead entity in your solution. Step 2: Make 2 main forms for the lead entity namely “Lead form” and “Sales Lead form” Step 3: Go to process – > Add a new process -> names It Lead creation. Step 4: In the same solution under lead entity add a field of type single line of text namely “Form Type”. Step 5: Add this new field on the lead form and the sales lead form. Note : This field will carry the form type of the form hence will be kept hidden and locked on both the forms. Step 6 : Next step is to get the form type in our form type field to achieve this we will use a web resource that      is a java script code Step 7 : By doing so we successfully bring the form type written in our single line of text field. Step 8 : Next step is to create a business process flow in the solution go to process and make a new business process flow. Step 9 : The above snapshot shows the business process flow to achieve the functionality here the create stage we take the form type as a parameter this is then passed to the condition to check the form type Step 10 : So, if the form type is Lead form it will be true and take business process flow for lead form. Step 11 : Else it will be false and will take the business process flow for the sales lead form. Note: – Make sure to add the business process flow as an entity to the solution and select the form and the business process flow in the site map of the app designer. Java Script code : (Onload of the Form) ChangeBPFByType = (executionContext) => {     debugger;     try {         let formContext = executionContext.getFormContext();         const selectedFormName = formContext.ui.formSelector.getCurrentItem().getLabel();         const getFormIdFromTxtBox = formContext.getAttribute(“cfs_formtype”).getValue();         //formContext.getControl(“header_process_cf_leadform”).setVisible(false);         if (formContext.data.entity.getId() == “”) {             formContext.getAttribute(“cfs_formtype”).setValue(selectedFormName);         }         else {             var getAllForms = formContext.ui.formSelector.items.get();             let navigateFormGuid = “”;             for (var i = 0; i < getAllForms.length; i++) {                 if (getFormIdFromTxtBox == getAllForms[i]._label) {                     navigateFormGuid = getAllForms[i]._id.guid;                     break;                 }             }             if (getFormIdFromTxtBox != selectedFormName) {                 formContext.ui.formSelector.items.get(navigateFormGuid).navigate();             }         }     } catch (e) {         alert(“Something went wrong please try again later”);     } } Hope that helps.!

Share Story :

Send an Email to all users in a D365 Team using power automate

D365 gives us a functionality to assign a record to a group of users which can be archived by using a D365 Team these users then are know as members of that respective team, due to functionality restrictions we cannot send an email to a  D365 team, however there are a few workarounds by which we can achieve this functionality. Lets consider a very case. Suppose we have a D365 team called as “Accounts Associates” we have added a set of users in this team. Now if an invoice milestone is in the ready state i.e. “Ready For Invoicing” we need to send a reminder email to this “Accounts Associates” team to take an action regarding the ready invoicing. Solution :- The following case can be achieved by using an Out of the box functionality i.e. By using a distribution list Note :- (we must have an Microsoft Exchange License). Lets Begin with the implementation. Step – 1 Creating a Distribution List Login to your admin center (Link –https://admin.microsoft.com/) In the Admin center  Section of the  Left navigation bar select “Exchange”. Under the “recipients” select “groups”. In the “+ New Microsoft 365 Group” pull down the dropdown and add the distribution list. Add the Display name and the “Alias” and save the Distribution list. Add same users which are present in the teams to this Distribution list. Step – 2 Creating a Queue in D365 Go to “Settings” -> “Service Management” ->” Queues” and click on “+NEW” -> give it a name -> “Save”  A mailbox would be created with the same name that of the queue.   Open the mailbox. The Email address field will be blank, add the Distribution List’s email address created in Step 1.    Step -3 Create a New Team or select an Existing Team. In the Default Queue lookup, select the Queue created in Step 2. Step – 4 Create a Flow which triggers on update of a project contract line milestone i.e. When status is ready for invoicing Flow triggers when Project Contract Line is Updated, Condition Invoice Milestone is Ready for invoicing for which click on the “…” select settings and add the following condition in the trigger section. Get the Teams ID in this case I have hardcoded the ID as no record was associated with it to retrieve it Get the Teams Details. Get the Default Queue to which the email will be triggered . Send an Email to the Incoming Email of that Queue which is Email ID set on the Distribution list. Note : (We will have to Manually add or remove the users from both the Distribution list and the Teams. i.e. both the team and the distribution list must be sync, if a member is added or removed from the team the same should be done in the distribution list ) Output . Hope this helps.!

Share Story :

Send an email to users in a D365 Team Individually using power automate (without using a distribution list)

D365 gives us a functionality to assign a record to a group of users which can be archived by using a D365 Team these users then are know as members of that respective team, due to functionality restrictions we cannot send an email to a  D365 team, however there are a few workarounds by which we can achieve this functionality. Lets consider a very case.Suppose we have a D365 team called as “Accounts Associates” we have added a set of users in this team. Now if an invoice milestone is in the ready state i.e. “Ready For Invoicing” we need to send a reminder email to this “Accounts Associates” team to take an action regarding the ready invoicing Solution :- The following case can be achieved by Looping through all the users in of a D365 Team.Lets Begin with the Implementation. Step 1 – Create a D365 Team.Go to Security – > Teams -> Create a new team. Step 2 – Create a Flow to send email.1. Flow triggers when Project Contract Line is Updated, Condition Invoice Milestone is Ready for invoicing for which click on the “…” select settings and add the following condition in the trigger section. 2.Get the Teams ID in this case I have hardcoded the ID as no record was associated with it to retrieve it3.Get the Teams Details.4.Get the User Details by using the following fetch XML Query. 5. Query :<fetch version=”1.0″ output-format=”xml-platform” mapping=”logical” distinct=”true”>   <entity name=”systemuser”>     <attribute name=”fullname” />     <attribute name=”businessunitid” />     <attribute name=”title” />     <attribute name=”address1_telephone1″ />     <attribute name=”positionid” />     <attribute name=”systemuserid” />     <attribute name=”internalemailaddress” />     <order attribute=”fullname” descending=”false” />     <filter type=”and”>       <condition attribute=”internalemailaddress” operator=”not-null” />     </filter>     <link-entity name=”teammembership” from=”systemuserid” to=”systemuserid” visible=”false” intersect=”true”>       <link-entity name=”team” from=”teamid” to=”teamid” alias=”ag”>         <filter type=”and”>           <condition attribute=”teamid” operator=”eq”  uitype=”team” value=”{Your Team ID}” />         </filter>       </link-entity>     </link-entity>   </entity> </fetch> For all the users Send an Email individually to the user OutputUser 1. Which is CRM Admin in my case in the team. User 2 Vidit Gholam system Administrator Hope that helps. !

Share Story :

How to bring in Project Task field from Resource Requirements to Time Entries if imported via, Bookings.

Import Bookings is one of the important features provided by PSA for users to do Time Entries quickly and efficiently. An issue faced while using this functionality is the Project Tasks are not imported with the Bookings Records (As Shown in the Image Below). A solution to this issue is two automated flows: To Bring the Project Tasks from Resource Requirements Entity to Bookable Resource Booking. Hence to bring the obtained Project Tasks from Bookable Resource Booking to Time Entries. Let’s Begin with the Implementation of the solution! (Flow To get Project Tasks from Resource Requirements to Bookable Resource Bookings) Step: 1 Bringing Project Tasks from Resource Requirement’s to Bookable Resource Booking. Step: 2 Update the Bookable Recourse Booking Record with the obtained project task. Now we have successfully obtained the Project task in the Bookable Recourse Bookings           Entity from the Resource Requirements, Our Next step is to Take this Project task on the Time Entries. (Flow to get Project Task from Bookable Resource Bookings to Time Entries) Step: 1 Bringing Project Task from Bookable Resource bookings to Time Entries. (Tip : It is better to check if the Project Task Field is empty or not hence we can also put a condition to do so, if the Project Task Field is empty proceed with updating the Project Task field else Terminate.) Step: 2 Get the Project Task from the Bookable Recourse Bookings. Step: 3 Update the Time Entries with the obtained Project task. Step: 4 Import Bookings and there you go you will now be able to see the Project Tasks. Hope this Helps!

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange