Skip to main content

Posts

Async Plugins vs. Power Automate Flows

Recent posts

XrmToolBox: AutoNumberUpdater - new StateCode filter

Mayank Pujara's AutoNumberUpdater plugin for the XrmToolBox is a great tool to add missing auto number values to an auto number field for an entity/table. In his blog you can find more details about the original version of his plugin: https://mayankp.wordpress.com/2021/12/09/xrmtoolbox-autonumberupdater-new-tool/ For my purposes I had to update accounts with missing account numbers, but in my use case this should only be done for those accounts that have the status value "Active".   As this plugin did not have this feature I quickly implemented it and Mayank merged my changes to his plugin source code. You can download the new version 1.2024.0.1 in the Tool Library of the XrmToolBox.

Power Automate: SharePoint Copy file action fails on file names with a plus (+) sign

  For data migration purposes I tried to copy files from one document library to another with the help of Power Automate's copy file action for SharePoint. At some point I realized that it always fails on file names that contain a plus (+) sign. Checking the community pages I found this article that pointed me to the right direction to find a workaround: https://powerusers.microsoft.com/t5/Building-Flows/Copying-sharepoint-files-with-a-symbol-in-them/m-p/675902#M91042 Although the "Copy file" action is already the second generation it seems like Microsoft has not managed to finally solve this bug as stated in article. The community user BISK came up with a solution to replace the file path with some HTML or URI encoding. Basically, the solution its a double URI encoded string of the path we need. We can solve this with using the encodeUriComponent() function in an expression twice. Sample: encodeUriComponent(encodeUriComponent('/Source/MyFolder/MyFiles with a + sign....

Power Automate: Avoid Apply to Each for List rows action (DataVerse)

If you do not want to use the Apply to Each loop after a Dataverse List rows action you can use the following in a Dynamic Content / Expression box to directly use a field's value in e.g. Compose action: first(outputs('List_rows')?['body/value'])?['apx_fullpath'] instead of apx_fullpath you can use whatever field name you need for the entity that's been queried before.

Workaround for broken sort buttons on the record creation and update rule items grid

In the customer service admin center app, if you open a "Record Creation and Update Rule" and go to Step two with the RCU items grid and you have more than 10 items in the subgrid available you might face a sorting bug which is recognized by Microsoft. Once you go to page 2 or any higher number and try so change the sort order / sequence number the sorting is not working or doing anything at all.   Microsoft support has given me this temporary workaround until this bug is fixed: Open the RCU item and open the Level Up for D365 Chrome extension and hit the "RECORD ID" button to retrieve the GUIDs of the source and target items that you want to switch the order. In Chrome browser hit F12 and go to the console tab. There insert the folloing lines of JavaScript to change the sequence number of each item: var data = { "sequencenumber" : "12" }; Xrm.WebApi.updateRecord( "convertruleitem" , "GUID of previous position number...

How to quickly update an attibute from a browser bookmark

 As a developer or tester sometimes its really nice to have a direct way to update an attribute on the current record. To accomplish that you can simply bookmark a new page in e.g. Chrome and add this little piece of JavaScript into the URL field: javascript:(function(){const curId=Xrm.Page.data.entity.getId();const entName=Xrm.Page.data.entity.getEntityName();const fldName = window.prompt("Please enter the attribute name");const fldValue = window.prompt("Please enter the attribute value");const jsdata={};jsdata[fldName]=fldValue;Xrm.WebApi.updateRecord(entName, curId.replace(/[{}]/g, ''), jsdata).then(function success(result) {window.alert('${entName} was successfully updated');},function (error){window.alert(error.message);});})() An alert box will ask you for the internal attribute name and a second for the value. This might not be the best way to do it but it will give you a clue on how to change it for your own needs. (This script will only work...

How to create new (missing) columns for entities in your Data Export Service Azure SQL database

Usually the Data Export Service (DES) automatically picks up changes on entities and creates new fields/columns in the Azure SQL database that is connected to your DES profile. Our experience was that this automatism is not always reliable thus we had to come up with a workaround. Microsoft Support suggested us to create missing columns on the export database ourselves manually, which I did. As there is currently no other official documentation on this topic I thought I should share this article with the rest of our awesome community. 1. Completely recreate the entity table The 1st approach to solve this issue would be to go inside your DES profile and deselect the target entity from the list of entities to sync and save the changes. Next delete the target entities tables and user defined table types with the script provided here: https://docs.microsoft.com/en-us/power-platform/admin/replicate-data-microsoft-azure-sql-database#how-to-delete-data-export-profile-tables-and-stored-procedu...