web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Virtual entity update of a boolean value failing using the SQL Server Connector

(5) ShareShare
ReportReport
Posted on by 24
We have multiple virtual entities connected to SQL Server tables via the SQL Server Connector, and we have been successfully updating records for a number of months.
 
Following a recent solution update from Microsoft to the Microsoft.Xrm.DataProvider.Connector.Plugin, we can't update a record if we reference a boolean field in the JSON (using Xrm.WebApi.updateRecord from javascript) - the MS plugin throws an error:
 
"Object of type 'System.String' cannot be converted to type 'System.Nullable`1[System.Boolean]'"
 
If we update without the boolean field, it works correctly.
 
Sample code:
        var record = {};
        var newRecordId = "<GUID HERE>";
        record.exampleBoolean = true;
        record.exampleText = "Test Text";
        var updateResult = await Xrm.WebApi.updateRecord("new_virtualentity", newRecordId, record);
 
Anybody else experiencing this or know of a workaround? (Ticket has been raised with MS)
Categories:
I have the same question (0)
  • Suggested answer
    Holly Huffman Profile Picture
    6,538 Super User 2025 Season 2 on at

    hi there! apologies if youve already done these: 

    1. Check Data Types: Ensure that the boolean field in your SQL Server table is correctly defined as a bit data type. Verify that the field in the virtual entity is mapped correctly to the boolean field in the SQL Server table.

    2. Update JSON Payload: Sometimes, the issue can be related to how the boolean value is being passed in the JSON payload. Ensure that the boolean value is being passed as true or false and not as a string.

      • Example:

        javascript
        var record = {};
        var newRecordId = "<GUID HERE>";
        record.exampleBoolean = true; // Ensure this is a boolean, not a string
        record.exampleText = "Test Text";
        var updateResult = await Xrm.WebApi.updateRecord("new_virtualentity", newRecordId, record);
        
    3. Use Alternate Methods: If the issue persists, consider using alternate methods to update the boolean field. For example, you can use a custom API or a Power Automate flow to update the field

  • Verified answer
    CU17021610-0 Profile Picture
    24 on at
    Just had the issue resolved by Microsoft on our environments, and a general fix will be released "in the next few weeks". Unable to clarify the nature of the fix (it was a "known issue") but as nothing was done to our SQL boxes it seems it was a backend fix to the connector or power platform.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 41

#2
Martin Dráb Profile Picture

Martin Dráb 36 Most Valuable Professional

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans