Notifications
Announcements
No record found.
Hello All,
I want to know whether it is possible to pass " Context as a First Parameter to a function,when the function is called from Ribbon Button Click",?
*This post is locked for comments
Modify your js like below &Try adding your js in the form
function callRibbonButton(executionContext) {
var attribute = executionContext.getEventSource();
var fieldName = attribute.getName();
var control = Xrm.Page.getControl(fieldName);
}
Refer below for how to pass context as first parameter in js
www.magnetismsolutions.com/.../dynamics_crm_2011_javascript_get_attribute_from_onchange
Hope this helps
Hi,Context is coming as "undefined " even after adding the JS Library into Form,
Note: i can't register the event on any field change,i want to call the function from ribbon only,is there any option to pass the context.
You would need to get the context from within the function. The ribbon button does not have a parameter for execution context.
How i will able to get?
Inside your function you can use Xrm.Page.context to get the context.
If that's not it, please describe what you are trying to do.
Basically i need this because i want to pass some parameters to my Action,for which i can't use the Xrm.Page as it will be Deprecated in future
Are you already using Dynamics 365 v9?
We have not upgraded yet to the new client side model for our solutions (mostly on D365 8.2), but this should still work on v9 as well.
For v9, you could be using Xrm.Utility.getGlobalContext:
docs.microsoft.com/.../getglobalcontext
We call a lot of actions from ribbon buttons, and are using the process.js library:
github.com/.../processjs
Hope this helps.
hi RK,
I dnt think it will be removed immediately . Still you can use it to get form metadata. Please find the below article for better clarity.
community.dynamics.com/.../new-in-v9-what-s-that-with-xrm-page-being-deprecated
Hi all,
Is there any solution for the posted question?
Thanks
Regards,
AW
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.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2