Skip to main content

Posts

Showing posts from 2020

How to deactivate Opportunity in Dynamics 365 with Power Automate Flow

  How to deactivate Opportunity in Dynamics 365 with  Power Automate Flow   This is going to be a simple article, to deactivate an Opportunity in Dynamics 365 through power Automate Flow, you just have to create an Opportunity Close Activity record   Make sure Status and Status Reason are properly set. Opportunity = opportunities({Guid of Opportunity})  

Dynamics 365 Power Automate Flow Send Email

Dynamics 365 Power Automate Flow Send Email In This Article we are going to describe a section of Power Automate Flow where we are going to create Email Message for Dynamics 365. Following this approach is going to make sure that the email message generate will be visible in our Activity Feed and the appropriate Email Message record are created in Dynamics 365 1.         Create a New Record a.        Entity Name “ Email Messages ” 2.        Set From, To, Cs and Bcc a.        You can not type email addresses on these fields b.        You are to create a reference to one of the following                                                                i.       System User                                                              ii.       Queue                                                            iii.       Contact                                                            iv.       Account c.        Make sure the above listed entities have a valid email addres

XMLHttpRequest vs Xrm.WebApi

  XMLHttpRequest vs Xrm.WebApi If you have written JavaScript code for Dynamics 365 you have seen the use of XMLHttpRequest or Xrm.WebApi to make server-side calls. The question is which one is the right one to use? So, let’s analyze the two types of calls. XMLHtttpRequest 1.        Synchronous a.        Sample Code var req = new XMLHttpRequest(); req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v9.1/accounts", false ); 2.        Asynchronous a.        Sample Code var req = new XMLHttpRequest(); req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v9.1/accounts", true ); So, passing true parameter is going to make asynchronous call while passing it false is going to make a Synchronous call. Xrm.WebApi 1.        Asynchronous a.        There is no way to make a synchronous call, even if you are going to use chaining or await keyword it still going to be an asynchronous call.   In c

Power Automate Flow How to Create Email Message with a Table of list of record.

  Power Automate Flow How to Create Email Message with a Table of list of record.   If you are working on a scenario where you must include a list of records in an email, then I would say keep on reading. Let’s pick a simple scenario, when and account is assigned to a user lets send the list of Contacts associated to the account to the new Owner.   Our next step is going to be , to retrieve all associated Contacts to the account, we are going to use the List records action from the Common Data Service, I prefer to use the Filter Query if you are not comfortable with rest calls just go ahead and use the Fetch Xml Query you can use advance find to build the appropriate Fetch Query   Here there are two options you can take:   Call Create HTML Table and build your table Build a list then pass the list to Create Html Table I personally prefer the second approach, its cleaner, it will give you the ability to select which fields you want to include in your table and

Create Power Automate Flow that triggers on Demand, Dynamics 365

  Create Power Automate Flow that triggers on Demand Let start by finding When a record is Selected     Note :- This component belongs to the old Common Data Service, I have noticed you can use it with the new Common Data Service, which is good in my book.   For our example here we are going to select Accounts as our Entity, you can enter your environment under Environment, it will take the URL of the environment you are targeting. If you have any parameters to pass to the Flow you can select any of the following Inputs         Text         Yes/No         File         Email         Number         Date Text 1.        Add drop-down list options :- will give you the ability to add dropdown values 2.        Add a multi-select list option :- as it name explains it will give you the ability to add multiselect 3.        Mas as Optional :- By default the Text is always required so if you want the Text Imput to be optional you select this one 4.        D

Power Automate Flow How to handle Empty Lookup Fields in Dynamics 365

I have seen a lot of complicated Power Automate Flows to handle Empty Lookup Values when trying to Update records. As you know setting a lookup field with empty value is going to cause the Power Automate Flow to error out. Example: Setting Lookup =   accounts() We are going to work with a scenario where we are going to retrieve Parent Account field value and populate it on another Account. To handle this issue, we are going to declare a variable that hold the Lookup Value (String)   Then we are going to analyze if the source record has Parent Account populated or not If the Parent Account has Value then we are going to set the variable with accounts(ParentAccount)   Otherwise we are going to set the value to null   The last thing to do here is to populate the field on your Update  This is going to save us time on our Power Automate Flow development and keep the flow clean and concise at the same time.    

How to use Formatted Values in Power Automate Flow Dynamics 365

  How to use Formatted Values in Power Automate Flow Dynamics 365   If you have been working on Power Automate for Dynamics 365 you might have been wandering how you can access a lookup Formatted Value or Option Set formatted values. You can use the following format to access: body(‘{Action Name}’)?[‘{fieldname} @OData.Community.Display.V1. FormattedValue’] You just have to be mindful in Dynamics 365 lookup field name they do not translate to the proper field name, you might have to and an “_” as a prefix and “_value” as a postfix, I will leave that to you.