Category Archives: Dynamics 365
Renaming SharePoint Folder using Microsoft Flows
Introduction: Using MS Flows, On any trigger, you can add the below action to rename the SharePoint folder. Steps: 1) In Actions, select “Send an HTTP request to SharePoint” 2) Enter the below details: Site Address: Select your site address from the list. Method: POST Uri:_api/web/GetFolderByServerRelativeUrl(‘LibraryTitle/CurrentFolderName’)//ListItemAllFields Headers: Accept application/json;odata=verbose X-HTTP-Method MERGE If-Match * Body: { Title :”New Name of Folder” FileLeafRef’:”New Name of Folder” } 3) The Folder Name in Uri and new folder names in body can be dynamic as per your requirement( Refer Screenshot below: the data here is taken directly from the trigger when file is created in SharePoint). Sample Output: Conclusion: Simple SharePoint Connector in MS Flows can help to rename a SharePoint Folder.
Share Story :
Filter Gallery based on lookup field (Combo Box) on EditForm
Introduction: In this blog, we will learn how to filter Gallery based on Combo Box which is on different form. Use Case: We have a requirement where there is a lookup field (Price List) on the Editform (Data Source: Quote Project Price List). When there is data in the lookup field the Gallery (Data Source: Role Price) should be filtered. Steps: 1. We have an Screen which is divided into two parts:(Edit Form + Gallery) a. Quote Project Price List Edit Form. b. Gallery with Role Price data source. 2. Add field into the Editable Grid (Gallery). 3. The Lookup Field on the EditForm is PRICE LIST on which the gallery is suppose to be filtered. 4. To filter the Gallery set the Items property of the Gallery to the following formula, Item property: Set Gallery.Item = Filter(‘Gallery Data Source’, ‘GalleryFieldName’.Name = ‘Form Lookup Field Name(Combo Box)’.Selected.Name) For eg: GalleryRolePrice.Item=Filter(‘Role Prices’, ‘Price List’.Name=PriceListLookup.Selected.Name) 5. Output of the screen, The Gallery is not visible as the Lookup Field (Price List) is not selected. 6. After selecting the Lookup Field (Price List), the gallery is visible and also filtered on the basis of the selected field. 7. In this way the Gallery will get Filtered on the basis of the Lookup field on the EditForm.
Share Story :
Mix and Match Discounts in Dynamics 365 Commerce (Retail)
In Dynamics 365 for Retail there are many types of discounts available which retailers can offer to customers. These discounts help the business increase the sales and also the customer base. One of the discounts is called Mix and Match Discount . A mix-and-match discount gives customers a discount when they purchase a specific combination of products. For example, a customer purchases two boxes of tea and receives 50 percent off the price of a tea cup. Products and variants can be included in mix-and-match discounts. Here is how you can configure Mix and Match discounts. In the above screen grabs you can see two types of mix and match discounts 1) Buy one product and get 50% off on the 2nd product 2) Buy one product and get another product free(100% off) You can add more products and use them in combination to offer discounts. After you have created discounts make sure to add your retail store to the price groups Hope this helps!
Share Story :
Threshold (amount-based) discount in Dynamics 365 for Retail(Commerce)
A threshold discount is a discount that is given to customers when the total for a transaction reaches one or more specified amounts. For example, you could create a discount that gives a 10 percent discount for purchases over 100.00 and a flat 25.00 discount for totals over 200.00. You can set it up from the following path Retail>Pricing and discounts Once you have configured the discount as per your requirement as shown here, do make sure you add a price group to it which has the the store mentioned where discount would be applied On POS whenever you sell an item from the Jewelry category and if the total bill is going over 1000$, customers will get 5% discount. Hope this helps!
Share Story :
Add lookup fields in an editable grid using PowerApps
Introduction: We had a requirement where we wanted to show the editable grid in power apps. The fields which are suppose to show are of string, decimal and lookup. Other data type was easy to display but we find difficulties in showing the lookup value. In this blog, we will learn how to add lookup fields(combo box) into the editable grid and also save it in Dynamics 365 CRM. Steps: 1. Insert Gallery : Insert a new gallery – Insert > Gallery > Blank Vertical Add Data Source to the Gallery Go to Properties > Click Data Source you want. 2. Add Combo Box input control in the PowerApps Grid. I have added 3 Combo Box input control inside the Grid, 2 text box, 1 is currency field in the data source and a Save icon. 3. For each Combo Box input box: Item Property: Set ComboBox.Item = Choices([@’Data Source’].<Field Name>) For eg: RoleComboBoxRP_1.Item = Choices([@’Role Prices’].Role) DefaultSelectedItems property: Set ComboBox.DefaultSelectedItems = ThisItem.<Field Name> For eg: RoleComboBoxRP_1.DefaultSelectedItems = ThisItem.Role 4. For each text input box: Default property: Set TextInput.Default = ThisItem.<Field Name> For eg: DescriptionRP_1.Default = ThisItem.Description Note: Do not forget to set the <DefaultSelectedItems> properties or else the value wont be visible in the grid. 5. To Save the changed value into the Data source, set the Save Icon to the following: OnChange property: Set SaveIcon.OnChange = Patch(DataSource, ThisItem, { <fieldName>: TextInput.Text, <fieldName>:ComboBoxName.Selected, <fieldName>:Value(CurrencyTextInput.Text) }) For eg: SaveRP_1.OnChange = Patch([@’Role Prices’], ThisItem, { Role : RoleComboBoxRP_1.Selected, ‘Resourcing Unit’:ResourcingUnitComboBoxRP_1.Selected, Unit:UnitComboBoxRP_1.Selected, Description:DescriptionRP_1.Text, Price:Value(PriceRP_1.Text) }) 6. The Output Screen. 7. The changed Lookup value. If you click the Save Icon the changed values will be saved. In this way we can change the Lookup values and also Save the changed value in the Dynamics 365 CRM.
Share Story :
Overview of Modern POS with Retail Store Scale Unit (RSSU)
Retail Store Scale Unit allows retailers to sell products within store locations that have internet connectivity issues, where it fails to connect with headquarters (HQ). Retail Store Scale Unit support both Modern POS and Cloud POS within the store. MPOS with Retail Store Scale Unit allows users to perform cross-terminal scenarios across multiple POS devices, like Suspend Shift Close Shift Blind Close Shift Manage Shift Inventory Lookup Stock Count Print X-Report Print Z-Report whereas Cloud-based MPOS offline fails to perform these operations. MPOS with Retail Store Scale Unit fails to perform real-time operations such as Issue/pay Gift Cards Issue Loyalty Card Picking and Receiving Pay by Customer Account Credit Card transactions Order Fulfillment View/Create Time clock entries unless there is internet connectivity to HQ or a payment provider. If most of your transactions involve real-time transactions, then your Store Scale Unit will always need internet connectivity to enable the connection to HQ or payment provider.
Share Story :
What is “Does not support untyped value in non-open type” ODataException in creating records in D365 CE?
One of the most common errors we come across while calling API to create records in Dynamics but isn’t clear what it means? One such issue is – “An error occurred while validating input parameters: Microsoft.OData.ODataException: Does not support untyped value in non-open type.” On the console of the browser, you’ll see this – But, if you open the <objectName>.responseText of the Failure message of the call, you’ll see the below – A more zoomed view of the error would be below – This is because of my typo in the code [Which is the case for most scenarios] where you mistype a name of the field and neither does the error itself doesn’t specify which field you’re missing out on nor what it means! Reason This is because of a simple typo in one of the fields in the object I was creating using AJAX In my case, this should have been “entity.duration” and not “entity.durationn“. It was a simple issue which led me wander troubleshooting in areas which I shouldn’t look into. Hope this saves you some valuable time! Happy 365ing!
Share Story :
How to use Expand Query in MS Flows
Introduction This blog explains how to use Expand Query (N:1 Relationship) in the Common Data Service List Records Connector. Steps to be followed: Initialize Variable of type string. Using Expand in list RecordsExpand Query: cf_Project($select=cf_projectname,cf_projectabbreviation) Here cf_Project is the Schema Name of Project Lookup field on location entity. Pass the field names of the project entity that you want. Here I have passed cf_projectname and cf_projectabbreviation. Result of list record: You can see we get Project value in the below format to use this we have to parse the JSON. “cf_Project”: “{\r\n \”cf_projectname\”: \”Client Commercial\”,\r\n \”cf_projectabbreviation\”: \”CC\”,\r\n \”cf_pmtrackerid\”: \”3b576605-9c82-e911-a839-000d3a07f695\”\r\n}” Retrieving Project Values. Use “Apply to each” to get the value of the Project. Pass “Value” of “List Records” from Dynamic Content in “Select an output from previous steps” Now Set the Value in the “Project” variable which we had initialized earlier. Go To Expression and type: items(‘Apply_to_each’)[‘cf_Project’] Note: Here “cf_Project” is what we had retrieved in the output of ‘list records’. Make sure you pass this value correctly. “cf_Project“: “{\r\n \”cf_projectname\”: \”Client Commercial\”,\r\n \”cf_projectabbreviation\”: \”CC\”,\r\n \”cf_pmtrackerid\”: \”3b576605-9c82-e911-a839-000d3a07f695\”\r\n}” Result of Project Variable: Parsing JSON. Use “Parse JSON” action Add “Project Variable” in Content from “Dynamic Content” Click on “Generate from sample” to generate JSON Schema Enter sample JSON payload and click on done. { “cf_projectname”: “Test Project”, “cf_projectabbreviation”: “TR”, “cf_pmtrackerid”: “3b576605-9c82-e911-a839-000d3a07f695” } It will generate a JSON Schema automatically. Using Project Values. After parsing Json successfully you can use the values of the project entity field. You can use “Compose” to get and check the value. Enter “cf_projectname” in “Compose” inputs. OutputEntire FLOW: NOTE: You can add multiple expand queries in List Record:Query: cf_Project($select=cf_projectname,cf_projectabbreviation),cf_ParentLocationId($select=cf_name)
Share Story :
Conversion of Time and Date in MS flow
Introduction We had a requirement where we wanted to create a price list with current date time with respect to current country. In this blog we will use the OOB date conversion functionality. Use Case : (UTC with ) We created a flow where we had used UTC now functionality but this was returning the value time value with -5.30 hours. After doing RND I come to know that it automatically adjust the time using our time zone. As you can see in the below screen shot. Solution: To over come with this issue we need to use the inbuilt functionality convertTimeZone. It takes below parameter Sr No Parameters Example Explanation 1. <timestamp> Utcnow() It is a string or function which contains the timestamp 2. <sourceTimeZone> UTC The name for source time zone . We can write source time zone which we want to convert into 3. <destinationTimeZone> India Standard Time The name for the target/destination time zone. In this case we want to convert UTC into India Standard Time. So the India Standard Time is a destination TimeZone 4. <format> dd/MM/yyyy HH:mm Its a format in this case we wanted to convert into date and time dd/MM/yyyy HH:mm As you can see in the below screen i have converted UTC to India time zone. convertTimeZone(utcnow(),’UTC’,’India Standard Time’,’dd/MM/yyyy HH:mm’) Result: As you can see in the below screen shot it shows the date time in the mentioned format or you can say indian format. Conclusion: Hope this will help you to over come the time zone issue while working with different country time. For more Time Zone conversion refer : https://docs.microsoft.com/en-us/previous-versions/windows/embedded/gg154758(v=winembedded.80)?redirectedfrom=MSDN
Share Story :
Share Records in D365 CRM by Code
Introduction: This blog details steps how to share entity record in D365 CRM by Code. Scenario: We have client requirement to share record with multiple set of Users in D365 CRM based on criteria selected by User on Form and needed to be automated. Implementation Step: Below code to be developed for OnCreate of record. Create new method ShareRecords private static void ShareRecords(IOrganizationService service, Entity entity, Entity segmentUser) { var CreatedReference = new EntityReference(“systemuser”, segmentUser.Id); var grantAccessRequest = new GrantAccessRequest { PrincipalAccess = new PrincipalAccess { AccessMask = AccessRights.ReadAccess | AccessRights.WriteAccess | AccessRights.AppendToAccess, Principal = CreatedReference }, Target = new EntityReference(entity.LogicalName, entity.Id) }; service.Execute(grantAccessRequest); } Retrieve User List of Users and execute ShareRecords method EntityCollection segmentUsers = service.RetrieveMultiple(new FetchExpression(fetchXMLUsers)); foreach(Entity segmentUser in segmentUsers.Entities) { ShareRecords(service, entity, segmentUser); } Below code to be developed for OnUpdate of record. Create new method UnShareRecords private static void UnShareRecords(IOrganizationService service, Entity entity, Entity segmentUser) { var CreatedReference = new EntityReference(“systemuser”, segmentUser.Id); var revokeUserAccessReq = new RevokeAccessRequest { Revokee = CreatedReference, Target = entity.ToEntityReference() }; service.Execute(revokeUserAccessReq); } Retrieve existing shared Users and remove there Access private static void RetrieveSharedUsers(IOrganizationService service, EntityReference entityRef) { var accessRequest = new RetrieveSharedPrincipalsAndAccessRequest { Target = entityRef }; var accessResponse = (RetrieveSharedPrincipalsAndAccessResponse) service.Execute(accessRequest); foreach(PrincipalAccess principalAccess in accessResponse.PrincipalAccesses) { EntityReference prAcc = principalAccess.Principal; Entity entity = new Entity(entityRef.LogicalName, entityRef.Id); Entity segmentUser = new Entity(prAcc.LogicalName, prAcc.Id); UnShareRecords(service, entity, segmentUser); } } Implement code for ShareRecords explained in step 1 & step 2. Conclusion: Hope this blog helps you to to share and unshare records by code in D365 CRM based on custom criteria data on record dynamically.
