[TIPS] Solution for error "Cannot read properties of undefined (reading 'getRelationship')" when click new button on Subgrid
When click the new button on subgrid, system throws an error: TypeError: Cannot read properties of undefined (reading 'getRelationship')
That button is set to use:/_static/_common/scripts/CommandBarActions.js function
Mscrm.GridCommandActions.addNewFromSubGridStandard
Two Issues:
- According to MS, all resources should now be prefaced by this tag
instead of directly given a path: $webresource:
- The function call is from a JS file that is no longer loaded in UCI(unified client interface). Found this online: Unfortunately, CommandBarActions.js has been deprecated in UCI, so this JS file is not loaded in UCI which then caused this error.
Old version using /_static/_common/scripts/CommandBarActions.js and a function of Mscrm.GridCommandActions.addNewFromSubGridStandard
New Version using $webresource:Main_system_library.js
XrmCore.Commands.Open.addNewFromSubGridStandard
No comments:
Post a Comment