Latest Microsoft Dynamics 365 Blogs | CloudFronts

Auto-refreshing Views or Grid in D365 CRM

We all know that Views show records based on filter criteria that is applied to the Views. But, what if there is a custom button that will change the records status and according to the Views filter criteria it should not be present in the View. The View should have been Auto-Refreshed. We can achieve this by JavaScript.  Use Case: We had a requirement where we wanted to Auto-Refresh the View as soon as the status of record is changed. We have a custom button that will change the status of the selected records but when the Status changes, it  doesn’t auto refreshes the View. We had to manually reload the page or click on refresh button on the View.  Steps: 1. When the status of the Record changes, you have the id of record then there’s a fully supported way which we can use to Auto-Refresh the View: “refreshParentGrid=Refreshes the parent grid that contains the specified record.” 2. In our case, We had the custom button which changes the status of the record. This is the code: Suppose the custom button is called as “Submit”. On clicking the button it should change the Status and also the records should not be visible in the view as the filter criteria is Status= “In Progress and Rejected” 1. The filter of the View. 2. On clicking the Submit Button, the selected record should not be visible. 3. The View Auto-Refreshed and the selected records are not visible in this View. Note: This can be used in Sub-grids of the forms also. Conclusion: I hope this blog helps you to Auto-Refresh the View.

Share Story :

Get/Read Selected Record Information From Main View Or A Sub-Grid using Ribbon Workbench In D365 CRM

There is a common application of getting selected records information while working with custom buttons using Ribbon Workbench. Use Case: We had a requirement, where we needed the information of the all selected records from the Main View and Sub-Grid of an entity. We can achieve in Ribbon Workbench. Steps: 1. The button on which we are customizing is named as “Submit”. 2. In the Command section, click on “Actions” -> “Javascript Action” to add Custom Javascript. Then click on “Add Parameter” -> Click on “Crm Parameter” -> then on  SelectedControlSelecteItemReferences. SelectedControlSelecteItemReferences = grabs the information of all selected record from the view. 3. SelectedControlSelecteItemReferences will pass the information of all the selected records in my “selectedItems” variable passed to the method. 4. On clicking the Submit Button, the selected records information will be passed on to the Javascript Code. 5. On clicking the “Submit” button, it will pass the two selected records information to the method that the button is calling. 6. You can further read all the information from the Array and perform the actions that you want. Note: This can be done in Sub-grids of the forms also. Conclusion: Hope this blog helps to get/read the selected Information from the Main View or Sub-Grid

Share Story :

Change colour of selected record of the Grid

Introduction: In this blog, we will learn how to change the colour of selected record of the Grid. Use Case: We have a requirement where there is a Grid of CDS Data Source, on clicking any record, it should get highlighted. Steps: There is a Screen on which there a Editable grid of custom Entity Objective. To Create an Editable Grid refer to the following link. https://www.cloudfronts.com/create-an-editable-grid-view-in-powerapps/ To add Lookup Fields in the Grid refer to the following link. https://www.cloudfronts.com/add-lookup-fields-in-an-editable-grid-using-powerapps/ This is the grid without highlighting any record. To change the colour of selected records, update the TemplateFill Property: TemplateFill property of the Deactivate Button: Set Gallery.TemplateFill =  If( <Guid of record> = <Selected Record GUID>, Color, Color  )   For eg: BrowseGalleryObjectives.TemplateFill= If( Objective = BrowseGalleryObjectives.Selected.Objective, RGBA(220, 231, 238, 1), RGBA(0,0,0,0) ) This is the grid with highlighting record. Conclusion: Hope above Blog helps you change the colour of selected record of the Grid.

Share Story :

Enable Record as Active or Inactive record in PowerApps

Introduction: In this blog, we will learn how to Enable multiple records as active or inactive record. Use Case: We have a requirement where there is a Grid of CDS Data Source, on clicking the Deactivate or Active Button on top of the Grid, it should Deactivate every record which is selected through the checkbox which is there on every record of the Grid. Steps: There is a Screen on which there a Editable grid of custom Entity Objective. To Create an Editable Grid refer to the following link. To add Lookup Fields in the Grid refer to the following link. This is the grid with a checkbox.  To Deactivate or Activate selected records, first create a Collection: OnSelect property of the Deactivate Button: When we select the Deactivate Button, it will collect all the records where the Checkbox is selected. To Deactivate the records from the CDS, set the OnSelect property of the Deactivate Button to the following formula: OnSelect property of the Deactivate Button: Combine the Whole formula in the OnSelect property of Deactivate Button : For eg: DeactivateSelectedRecord.OnSelect =  Note: For Activating the record just replace the Inactive to Active in the Patch Formula Conclusion: Hope above Blog helps you Activate, Deactivate multiple records of CDS from the Grid.

Share Story :

Change the Position of Data Card on the Form in PowerApps.

Introduction: In this blog, we will learn how to set the position of Data Card in form. Steps: 1.This is the form of Quote Product. Where all the Data Card is placed one after another. 2.We want this card to be beside one another. 3.To achieve this, click on the Data Card and change X and Y property. 4.These are the X and Y of different Data Card. Conclusion: Hope the above Blog helps you to Change the Position of Data Card in Form.

Share Story :

Lookup Field with multiple search columns in PowerApps.

Introduction: In this blog, we will learn how to set multiple search fields in a Lookup Field. Use Case: We have a requirement where there is a Field (Data Field: Lookup) on the form, which should search records according to multiple columns. The Field on the Form is a Combo Box Steps: 1. This is the form of Quote Product. We want to allow searching based on multiple column. 2. To allow searching based on multiple fields, click on the Combo Box. Items property: Set ExistingProduct.Items =  Sort(                                                    Filter(                                                        Filter(                                                               Data Source,                                                               Condition                                                              ),                                                           StartsWith(                                                                 Text, SearchText                                                      ) Or StartsWith( Text, SearchText                                                 )                                       ),                                            ColumnName                                        ) For eg: ExistingProductQPEditForm_2.Items =Sort(                                                             Filter(                                                                     Filter(                                                                                 [@Products],                                                                                 Status = ‘Status (Products)’.Active                                                                              ),                                                                    StartsWith(                                                                                ‘Product Code’,                                                                                ExistingProductQPEditForm_2.SearchText                                                                              ) Or StartsWith(                                                                              Name,                                                                              ExistingProductQPEditForm_2.SearchText                                                                               )                                                                       ),                                                                      Name                                                                 ) SearchFields property: Set ExistingProduct.SearchFields =  { “ColumnName”, “ColumnName”} For eg: ExistingProductQPEditForm_2.SearchFields = {“cf_productcode”, “name”} Conclusion: Hope the above Blog helps you to search based on multiple columns for the Lookup field.

Share Story :

Updating multiple CDS records from Grid using PowerApps

Introduction: In this blog, we will learn how to Update multiple records of CDS from the Grid.   Use Case: We have a requirement where there is a Grid of CDS Data Source, on clicking the Save Icon on top of the Grid, it should Save every record which is selected through the checkbox which is there on every record of the Grid.   Steps: 1. There is a Screen on which there is an Editable grid of Quote Product Entity. To Create an Editable Grid refer to the following link. https://www.cloudfronts.com/create-an-editable-grid-view-in-powerapps/ To add Lookup Fields in the Grid refer to the following link. https://www.cloudfronts.com/add-lookup-fields-in-an-editable-grid-using-powerapps/ 2. This is the grid with a checkbox. 3. To Save selected records, first create a Collection:           OnSelect property of the Delete icon:           Set SaveIcon.OnSelect =  ClearCollect( <VariableName>, Filter( <GalleryName>.AllItems, <CheckBoxName>.Value = true ) ) For eg: SaveSelectedRecord.OnSelect= ClearCollect( SelectedQuoteProduct, Filter( GalleryQuoteProduct.AllItems, CheckboxQuoteProductGallery.Value = true ) )   4. When we select the Save Icon, it will collect all the records where the Checkbox is selected. 5. To Save the records from the CDS, set the OnSelect property of the Save Icon to the following formula:           OnSelect property of the Delete icon:           Set SaveIcon.OnSelect =  ForAll( <CollectionVariable>, Patch( ‘Gallery Data Source’, <GUID you want to delete> { <fieldName>: TextInput.Text, <fieldName>:ComboBoxName.Selected, <fieldName>:Value(CurrencyTextInput.Text) } ) ) For eg: SaveSelectedRecord.OnSelect=ForAll( SelectedQuoteProduct, Patch( [@’Quote Products’], LookUp( [@’Quote Products’], ‘Quote Product’ in SelectedQuoteProduct[@’Quote Product’] ), { ‘Product Code’: ProductCodeQPGallery.Text, ‘Product Name’: ProductNameQPGallery.Text, Quantity: Value(QuantityQPGallery.Text), ‘Sales Price’: Value(SoldPriceQPEditform.Text), ‘Discount Amount’: Value(DiscountAmountQPGallery.Text), Tax:Value(TaxQPEditForm.Text), ‘Extended Amount’: Value(ExtendedAmountQPGallery.Text) } ) )   6. Combine the Whole formula in the OnSelect property of Save Icon :           For eg: SaveSelectedRecord.OnSelect= ClearCollect( SelectedQuoteProduct, Filter( GalleryQuoteProduct.AllItems, CheckboxQuoteProductGallery.Value = true ) )  ForAll( SelectedQuoteProduct, Patch( [@’Quote Products’], LookUp( [@’Quote Products’], ‘Quote Product’ in SelectedQuoteProduct[@’Quote Product’] ), { ‘Product Code’: ProductCodeQPGallery.Text, ‘Product Name’: ProductNameQPGallery.Text, Quantity: Value(QuantityQPGallery.Text), ‘Sales Price’: Value(SoldPriceQPEditform.Text), ‘Discount Amount’: Value(DiscountAmountQPGallery.Text), Tax:Value(TaxQPEditForm.Text), ‘Extended Amount’: Value(ExtendedAmountQPGallery.Text) } ) )   Conclusion: Hope the above Blog helps you Save multiple records of CDS from the Grid.

Share Story :

How to Set Default value of Two Options on New form using PowerApps

Introduction: In this blog, we will learn how to set Default Value of Two Options on New Form.   Use Case: We have a requirement where there is a Field(Data Field: Two Options) on the form, which should show “NO” as Default value. The Field on the Form is a Combo Box.   Steps: 1. This is the form of Quote Product. We want to set Override Price as NO.   2. To set Default value of the field, click on the Combo Box.           DefaultSelectedItems property:           Set OverridePrices.DefaultSelectedItems =  { Value: <Field Name>.No} For eg: OverridePricesComboBoxQPForm.DefaultSelectedItems = {Value: ‘Override Prices (Quote Products)’.No}   Conclusion: Hope the above Blog helps you to set Default Value of Two Options on New Form.

Share Story :

Delete multiple CDS records from Grid using PowerApps.

Introduction: In this blog, we will learn how to Delete multiple records of CDS from the Grid.   Use Case: We have a requirement where there is a Grid of CDS Data Source, on clicking the Delete Icon on top of the Grid, it should delete every record which is selected through the checkbox which is there on every record of the Grid.   Solution: Steps to be followed: 1. There is a Screen on which there a Editable grid of Quote Product Entity. To Create an Editable Grid refer to the following link. https://www.cloudfronts.com/create-an-editable-grid-view-in-powerapps/ To add Lookup Fields in the Grid refer to the following link. https://www.cloudfronts.com/add-lookup-fields-in-an-editable-grid-using-powerapps/ 2. This is the grid with a checkbox. 3. To delete selected records, first create a Collection:          OnSelect property of the Delete icon:          Set DeleteIcon.OnSelect = ClearCollect(<VariableName>,Filter(<GalleryName>.AllItems,<CheckBoxName>.Value = true ))          For eg: DeleteSelectedRecord.OnSelect= ClearCollect(SelectedQuoteProductDelete,Filter(GalleryQuoteProduct.AllItems,CheckboxQuoteProductGallery.Value = true)) 4. When we select the Delete Icon, it will collect all the records where the Checkbox is selected. 5. To delete the records from the CDS, set the OnSelect property of the Delete Icon to the following formula:          OnSelect property of the Delete icon:          Set DeleteIcon.OnSelect =  ForAll(<CollectionVariable>,RemoveIf(‘Gallery Data Source’,<GUID you want to delete>))          For eg: DeleteSelectedRecord.OnSelect =  ForAll(SelectedQuoteProductDelete,RemoveIf( [@’Quote Products’], ‘Quote Product’ in SelectedQuoteProductDelete[@’Quote Product’] )) 6. Combine the Whole formula in the Set OnSelect property of Set DeleteIcon : For eg: DeleteSelectedRecord.OnSelect =  ClearCollect(SelectedQuoteProductDelete,Filter(GalleryQuoteProduct.AllItems,CheckboxQuoteProductGallery.Value = true)); ForAll(SelectedQuoteProductDelete,RemoveIf([@’Quote Products’],’Quote Product’ in SelectedQuoteProductDelete[@’Quote Product’]) ) Conclusion: Hope above Blog helps you delete multiple records of CDS from the Grid.

Share Story :

Hide certain Field of the form depending on Security Role of the User using PowerApps.

Introduction: In this blog, we will learn how to hide fields from the form based on the Security Role of the Logged in User. Use Case: We have a requirement where there are some Fields in the form, which should be hidden to the users who does not have the Security Role as Manager. Steps: 1. This is the form of Quote Product. We want to hide the Price Overriden field from the form to certain Users. 2. To hide the field, click on the DataCard.         Visible property of the DataCard:          Set Price Overridden_DataCard.Visible =  If(LookUp([@’Security Roles’],Name = “Manager”,Role) in Concat(LookUp([@Users],’Full Name’ = User().FullName).’Security Roles(systemuserroles_association)’,Role & “;”),true,false)   Conclusion: Hope the above Blog helps you to hide fields from the form based on the Security Role of the Logged in User.

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange