Notifications
Announcements
I am using Microsoft Dynamics 365 Sales Online and I want to get DOM element from XRM.Page object using JavaScript. So, how can I get access to input that is underlies the control (or attribute) element got from Xrm.Page.getContext("any name") or Xrm.Page.getAttribute("any name"). Thank you for the hints in advance!
Hi Alexander.Zaporozhets,
Is this what you are looking for? formContext.getAttribute("name").getValue();. For more details read it out: Tutorial: Write your first client script in model-driven apps - Power Apps | Microsoft Learn.
If I answer your question then please mark it as verified.
Let me know if I can provide you with more details.
ThanksRegards,
Abdul WahabPower Platform & Customer Engagement Developer/Lead/Solution Architecture/Project ManagerDirect/WhatsApp:+923323281237E-mail: abdulwahabubit@outlook.comSkype: abdul.wahabubitLinkedin: www.linkedin.com/.../
Abdul Wahab’s answer is correct, just add more details.
Xrm.Page is deprecated(Although it can still work by now, but it's not recommended to use it ), please use formContext instead. So you should use formContext.getAttribute("[column logical name]").getValue to get field value and formContext.getControl("[column logical name]") to get element control.
You can find column logical name here:
Reference:
Client API Reference for model-driven apps - Power Apps | Microsoft Learn
attribute.getValue (Client API reference) - Power Apps | Microsoft Learn
Controls in model-driven apps for Dynamics 365 - Power Apps | Microsoft Learn
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Pallavi Phade 98
Tom_Gioielli 79 Super User 2025 Season 2
TAHER Mehdi 48