Skip to main content

Posts

Showing posts from 2022

XrmToolBox: AutoNumberUpdater - new StateCode filter

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