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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Xrm set attribute value gets reverted sometimes

(0) ShareShare
ReportReport
Posted on by
I need to change the value of a textarea field (that has the control of fieldControl-text-box-text), but I am running into issues.
 
As context, I am trying to do the change via a browser extension - so I don't have access to the form context.
 
Here is what I am doing:
1. If the field is focused, I insert the content directly (textareaElement.value = newContent).
2. If the field is not focused, I am using the Xrm.Page API (Xrm.Page.getAttribute(fieldName).setValue(newContent))
 
While this strategy works most of the time, it doesn't in 1 out of 10 cases.
These mainly happen when the field is not focused - when using the Xrm API.
 
In these cases, the textarea gets the new value (so Xrm.Page.getAttribute(fieldName).getValue() returns the proper new content) but then gets reverted after some milliseconds.
I have a way of detecting it - a timeout that checks after 100ms if the content is still the one I want, but no solution on how to fix it.
 
These reverts happen in the following situation: the user clicks on a word, and the focus is moved to a new area from which he clicks some text to replace the word.
 
Do you have any idea what I'm doing wrong?
Is there some period when all updates to the textarea get reverted?
Do I need to do some extra step after setValue?
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 196 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans