When Calling javaScript Function from Ribbon button , you might get error executioncontext.getformcontext is not a function because Primarycontrol gives Form context not the execution context.
Error screenshot.
Below is the full Error :
TypeError: executionContext.getFormContext is not a function
at SetUppercase (https://***.crm.dynamics.com/%7B636700249930001087%7D/WebResources/***_Common.js?ver=2021682843:19:40)
at eval (eval at RunHandlerInternal (https://***.crm.dynamics.com/form/ClientApiWrapper.aspx?ver=2021682843:153:1), <anonymous>:1:1)
at RunHandlerInternal (https://***.crm.dynamics.com/form/ClientApiWrapper.aspx?ver=2021682843:159:1)
at RunHandlers (https://***.crm.dynamics.com/form/ClientApiWrapper.aspx?ver=2021682843:118:1)
at ExecuteHandler (https://***.crm.dynamics.com/form/ClientApiWrapper.aspx?ver=2021682843:81:1)
at Mscrm.TurboForm.Control.CustomScriptsManager.$De_1 (https://***.crm.dynamics.com/_static/form/formcontrols.js?ver=2021682843:5093:100)
at Mscrm.TurboForm.Control.CustomScriptsManager.executeHandler (https://***.crm.dynamics.com/_static/form/formcontrols.js?ver=2021682843:5031:18)
at Mscrm.TurboForm.Control.CustomScriptsManager.executeHandlerByDescriptor (https://***.crm.dynamics.com/_static/form/formcontrols.js?ver=2021682843:5062:18)
at https://***.crm.dynamics.com/_static/form/formcontrols.js?ver=2021682843:5073:19
at https://***.crm.dynamics.com/_common/global.ashx?ver=2021682843:6823:193161
SOLUTION :
follow the link : http://microsoftdynamics.in/2020/08/22/error-getformcontext-is-not-a-function-in-uci-ribbon-button/