Hi
I have following script:
function changevisibilitybutton() {
*This post is locked for comments
Hi Shidin
Thank you, changed code to use above method
Decio
Great that your issue is resolved. You might also want to stop using 'Xrm.Page' methods, and instead start using the 'ExecutionContext.getFormContext ' instead.
Happy D365'ing!
removed parameter from handler properties and its now working, thank you
Hi,
var ready = Xrm.Page.getAttribute(acc1_readytocreate).getValue();
Please write attribute name within double quotes.
Thanks & Regards,
Aman Anvaria
still no luck.
get same error:
ReferenceError: acc1_readytocreate is not defined
at eval (eval at RunHandlerInternal (test444.crm11.dynamics.com/.../ClientApiWrapper.aspx), <anonymous>:1:24)
at RunHandlerInternal (test444.crm11.dynamics.com/.../ClientApiWrapper.aspx)
at RunHandlers (test444.crm11.dynamics.com/.../ClientApiWrapper.aspx)
at OnScriptTagLoaded (test444.crm11.dynamics.com/.../ClientApiWrapper.aspx)
at test444.crm11.dynamics.com/.../ClientApiWrapper.aspx)
the field in question is a two options one. Perhaps that's the issue
Hi,
Please try to run code provided by Goutam.
If still facing any issue/error, please share.
Thanks & Regards,
Aman Anvaria
Okay , could you please debug the code , may be you are missing something in attribute name or webresource name . The code looks perfect for me .
And please share which line you are getting error.
Exactly this is the issue , you are using getValue() twice .
Try with this-
function changevisibilitybutton() { var ready = Xrm.Page.getAttribute("acc1_readytocreate"); if(ready!= null) { if (ready.getValue() == 1) { Xrm.Page.getControl("WebResource_create").setVisible(true); } } }
Just realized I posted wrong code. Still same issue with following.
function changevisibilitybutton() {
var ready = Xrm.Page.getAttribute(acc1_readytocreate).getValue();
if (ready == 1) {
Xrm.Page.getControl(WebResource_create).setVisible(true);
}
}
Hi,
Why are you using getValue twice?
Thanks & Regards,
Aman Anvaria
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6