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...
Suggested Answer

RowVersion on Unified Interface

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I would like to know if after Unified interface transition there is a way to achieve the entityRowVersion on WebResources, as could be done before with: "window.parent.Xrm.Page.data.entity.getRowVersion()"? Thx


I have the same question (0)
  • Suggested answer
    Henry J. Profile Picture
    5,237 on at

    Hi Alexandre,

    What exactly are you trying to achieve?
    Does it have to do with grids and subgrids? If yes, the supported Client APIs are documented here:
    Grids and subgrids in model-driven apps for Dynamics 365 - Power Apps | Microsoft Docs

    If it's more about Xrm.Page, although it is deprecated, parent.Xrm.Page will continue to work in case of HTML web resources embedded in forms as this is the only way to access the form context from the HTML web resource:
    Important changes (deprecations) coming in Power Apps, Power Automate and customer engagement apps - Power Platform | Microsoft Docs

    Henry

  • Alexandre Campos Profile Picture
    5 on at

    Thx for feedback Henry Jammes.

    My concerns are about parent.Xrm.Page. Altough it will continue to work, the information that can be obtained using it got some modifications, and now I can't find a way to get the rowVersion information as I could do previously with "window.parent.Xrm.Page.data.entity.getRowVersion()".

  • Henry J. Profile Picture
    5,237 on at

    The getRowVersion Client API isn't documented (and so is unsupported).

    Can you share a bit more on why you're using it?

  • Alexandre Campos Profile Picture
    5 on at

    I am using RowVersion property for concurrency purposes. I pass the rowVersion value in a HTTP request, and so my API can then compare when trying to get/update the entity record if no changes occurred since the HTTP request was performed.

  • Suggested answer
    miguelbeja Profile Picture
    on at

    Hi Alexandre,

    Like Henry mentioned, looking into the documentation Client API Reference for model-driven apps - Power Apps | Microsoft Docs it isn't being referenced in any place about getRowVersion() for the Xrm.Page, which means it is an internal function that was accessible in WebClient but not anymore in Unified interface and it was being used in an unsupported way.

    I would recommend you to have a look into this https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/perform-conditional-operations-using-web-api#apply-optimistic-concurrency and apply this new kind of logic to your development.

    When a User opens a record you should get that "@odata.etag": "W/"470867", when the user changes and submits it, you should add to the request the If-Match on the update request, then it can be validated if the user is updated "his" version of the record, if it fails, then it isn't the same version.

    pastedimage1607960072908v3.png

    Retrieve an account sample:

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/retrieve-entity-using-web-api#retrieve-specific-properties

    pastedimage1607959972429v1.png

    You also need to be sure that the Entity has Optimistic concurrency enabled

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/perform-conditional-operations-using-web-api#entity-must-have-optimistic-concurrency-enabled

  • Alexandre Campos Profile Picture
    5 on at

    Thx Miguel Beja,

    Can you tell me if the mentioned ETag can be used also with .NET OrganizationService (Microsoft.Xrm.SDK) ? My API is using it to update entities and I would like to keep using it.

  • Suggested answer
    miguelbeja Profile Picture
    on at

    Hi, RowVersion for OrganizationService is still going to work. What you mentioned in the beggining was regarding JavaScript for WebResourecs right?

    Not sure if the Etag is going to be the same but you can test it.

    docs.microsoft.com/.../entity-operations-update-delete

    For Plugin you need to do the UpdateRequest or DeleteRequest and take into consideration doing this:  ConcurrencyBehavior = ConcurrencyBehavior.IfRowVersionMatches.

    The documentation above has sample.

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
Martin Dráb Profile Picture

Martin Dráb 47 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

#3
Pallavi Phade Profile Picture

Pallavi Phade 32

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans