Hello All Experts,
I need to apply css for the fied display on the form .
any help will be appreciable.
*This post is locked for comments
Hi,
This would be an unsupported customization. It would be better if you create your own web resource.
If you decide to go ahead with this anyway, you can use jquery or access the dom (using getElementById) to modify the style or class of that specific control.
Hope this helps.
Unfortunately not. The UI is what it is, and it's not customizable.
Hello Aric,
While trying to use the getElementById , it's throwing an error .
style cannot be applied to the null object kind of.
is there any way to avoid this.
Hello Experts,
1. Xrm.Page.getAttribute('new_field').getValue(); xyz //working
2. document.getElementById('new_field') undefined. //not working
why 2 point not able to get the value.
Try
parent.document.getElementById('new_field')
but what you're doing is unsupported customization.
I forget to write parent as prefix earlier .
the actual line was parent.document.getElementById('new_field').
as mentioned earlier it's the same UNDEFINED or null causing error.
any other method which we could use to override this.
When you access elements from DOM, you need to specify the actual id which is different than the schema name of the field . It would be either <schemaname>_i or <schemaname>_d. You can use developer tools to get the actual id.
You can then try this-
var phone = parent.document.getElementById("telephone2_i");
phone.style.color = "red";
PS: As mentioned above, this is unsupported which means there is no guaranty that if it works now, it will always work in future :)
Hope this help.
Keep in mind document.getElementById is not supported anymore so no use of putting your effort on writing your code, as it will break definitely better to go with custom html web resource and implement your logic there.
Hello Ravi, Which developer tool to be used, can you elaborate a little.
Hello Mahendra, it was already being implemented by the other developer, now client wants the same.
The inbuilt browser developer tool (F12).
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 Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Community Member 2
UllrSki 2
SC-08081331-0 1