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 :
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

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans