Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

Javascript and Ribbon Issues Post migration to Unified Interface

Posted on by 105

Hi All,

I've currently enabled UI for our D365 CE test instance and while testing the functionalities I'm facing the below issues with Javascript. Was hoping for assistance these if any of you have faced similar issues.

1) Currently we have a HTML Webresource on the Order form which allows attachment of files. We've used the below command to attach the file by using the object type code, and guid of the order record
parent.Mscrm.RibbonActions.addFileToRecord(entityETC, entityID);

In the classic UI, this was working fine, but the MSCRM option in UI does not have RibbonActions or addFileToRecord and in the debug mode(PF12), it shows an error that Mscrm.RibbonActions.addFileToRecord is undefined

Do we need to use a different command and Is there a workaround for this issue in UI?

In UI the MSCRM object does not show RibbonActions function under it, hence the addFileToRecord function is not available, resulting in the above error, as seen below:

Whereas in Classic UI, MSCRM object contains the RibbonActions function and the sub-functions:

2) The other JS error is while clicking on the custom ribbon buttons, we see that the below error is being displayed. What changes should be made to support this in UI ?

Error: Invalid JavaScript Action Library: /_static/_common/scripts/CommandBarActions.js is not a web resource and is not supported.

Thanks again for your assistance.

Regards,

Toly

  • Toly Rogers Profile Picture
    Toly Rogers 105 on at
    RE: Javascript and Ribbon Issues Post migration to Unified Interface

    Thanks Leo, will check these links

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Javascript and Ribbon Issues Post migration to Unified Interface

    Hi partner,

    1.About the ribbon has no actions, you could refer to the troubleshooting guide.

    https://support.microsoft.com/en-us/help/4552163/ribbon-troubleshooting-guide

    2.You could replace some Xrm.Page functions to executionContext, for more information, you  could refer to this blog.

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/clientapi-form-context

    https://alphabold.com/xrm-page-is-deprecated-how-do-i-use-formcontext-in-dynamics-365/

    Regards,

    Leo 

  • Toly Rogers Profile Picture
    Toly Rogers 105 on at
    RE: Javascript and Ribbon Issues Post migration to Unified Interface

    Hi Leo,

    Thank you for your response.

    For Point#1 I'll create a ticket for MS.

    For Point#2 I could not find Dynamic_Property_main_system_library in Ribbon workbench, but found $webresource:Sales/DynamicProperty/DynamicProperty_main_system_library.js, so tried to use that to test a custom JS action, to trigger an OnDemand workflow as below, but on clicking on the button, no action happens, I'm I doing something wrong here ?

    pastedimage1596434769182v1.png

    Also, is the XRM.page deprecated and cannot be used in Unified Interface, will we have to make the changes in all the Javascripts which we have on the CRM forms while transitioning to UI?

    Regards,

    Toly

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Javascript and Ribbon Issues Post migration to Unified Interface

    Hi partner,

    1.This action is not supported in UCI, UCI has different frameworks with Classic UI so many old actions are no more supported in UCI. You could raise tickets to Microsoft to find out the alternative action.

    2.Unfortunately, CommandBarActions.js has been deprecated in UCI, so this JS file is not loaded in UCI which then caused this error. Please try this library instead:"$webresource:Dynamic_Property_main_system_library".

    https://ribbonworkbench.uservoice.com/knowledgebase/articles/785901-check-if-you-need-to-update-your-ribbon-customisat

    Regards,

    Leo

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans