{Dynamics CRM Error} The formatter threw an exception while trying to deserialize the message


Dynamics CRM's avatarxrm CRM Dynamics

Today while working on one of the queryexpression code in my project I faced this issue.

Error Details

Message=The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.microsoft.com/xrm/2011/Contracts/Services:request. The InnerException message was 'Error in line 1 position 1836. Element 'http://schemas.microsoft.com/2003/10/Serialization/Arrays:anyType' contains data from a type that maps to the name 'FaultMetadataToCDSAlert:IotAlertStateCode'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name 'IotAlertStateCode' and namespace 'FaultMetadataToCDSAlert'.'.  Please see InnerException for more details.
  Source=Microsoft.PowerPlatform.Cds.Client
  StackTrace:
   at Microsoft.PowerPlatform.Cds.Client.CdsServiceClient.RetrieveMultiple(QueryBase query)
   at FaultMetadataToCDSAlert.Program.Main(String[] args) in D:MicrosoftrepoSamplesSamplessrcCreate-Dynamics-EntitiesFaultMetadataToCDSAlertProgram.cs:line 89

C# Code

// build query expression that finds the Iot Alert with the Hash value supplied in the fault QueryExpression queryExpression = new QueryExpression() { Distinct = false, EntityName = DynamicsEntities.IoTAlert, ColumnSet = new ColumnSet(IoTAlertProperties.MsdynAlertToken), Criteria…

View original post 120 more words

Get RequiredAttendee (Required) from the Meeting (appointment) table – Power Automate / Dataverse


Below is the sample flow we can use to retrieve the Required (requiredattendees) field’s value from the Meeting table (on the update of the record).

Here we are triggering the flow, if there is an update in the subject field of the meeting record.

Then using the List rows action we are fetching the Activity Parties record associated using the Appointment’s unique identifier and participation mask as 5.

More on participation type mask

And in the last step, we are checking for all the associated Activity Party GUIDs for a specific GUID and then update the record or cancel the record.

Hope it helps..

Advertisements

Filter rows using contains, startswith and endwith Power Automate – Dataverse


Recently in one of our projects, we were using the Microsoft Bookings App for the users to book an appointment(outlook) and then were syncing this appointment back to Dynamics 365 through the category “Tracked to Dynamics 365” (Server Side Synchronization)

Get more details on it here – https://nishantrana.me/2022/03/22/how-to-synchronize-appointments-between-dynamics-365-and-outlook-using-server-side-synchronization/

Here if the users were canceling the tracked appointment in Outlook, it will update the subject of the appointment record with the prefix – Canceled but will not cancel the record i.e. update the status of the record.

This would happen if the user canceling the appointment is not the organizer.

https://learn.microsoft.com/en-us/power-platform/admin/sync-logic#syncing-canceled-and-deleted-appointments-from-exchange-to-dynamics-365

So here we were implementing a flow to check for updates in the Subject column with the word canceled and then updating the status of the appointment as canceled.

Here we can specify our select columns and filter conditions as follows – contains

Or startswith

https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/query-data-web-api#standard-query-functions

Hope it helps..

Advertisements

Using existing Web Resources (image) and Icons for button/ command – Dynamics 365 / Model-driven apps


In case of a new command that is added through Command Designer, we can specify an existing Icon using the Use Icon option.

We can also search and specify an existing Web Resource

Similarly, we can use Icon Gallery (XrmToolBox Plugin) to search for the existing web resource image and icons.

We can then use Copy Name option to get the full path of the web resource

msdyncrm_/KnowledgeManagement/_imgs/KnowledgeSearchProvider.svg

use it to specify Modern Image for our buttons

Hope it helps..

Advertisements

Hide Show Button in Command Bar / Ribbon in Dynamics 365 / Model-Driven App (For Quick Reference)


Open the App in the App Designer, select the Edit Command Bar for the table

Also, check the limitations of the Command designer, the important one being that the pre-existing classic commands cannot be customized with the new command designer.

For the new Command added, set its Visible property based on the status of the current selected item/record.

More on Power Fx

Now similarly if we want to show the button only for an existing record by updating the RibbonDiffXML, we can write the following DisplayRule based on FormStateRule



Hope it helps..

 

Advertisements

Error when trying to retrieve data from the network – Power Apps/ Dataverse


Recently in one of the custom pages (canvas app), we started getting the below error “Error when trying to retrieve data from the network” and no data was being retrieved.

Decreasing the data row limit to 500 from 2000 seemed to fix this issue for us.

I assume it could be because of the number of records increasing in the environment over time causing this issue.

Interestingly after a few days when we tried to check the root cause of the issue, by increasing the row limit back to 2000, we weren’t getting that error anymore.

Articles to refer –

https://thepoweraddict.com/how-to-fix-error-when-trying-to-retrieve-data-from-the-network/

https://powerusers.microsoft.com/t5/Building-Power-Apps/quot-Error-when-trying-to-retrieve-data-from-the-network-quot-on/td-p/1452970#:~:text=This%20may%20be%20a%20temporary,connection%20to%20test%20it%20again.

https://sharepains.com/2022/07/04/error-when-trying-to-retrieve-data-from-the-network/

Hope it helps..

 

Advertisements