Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

Ribbon Workbench - JavaScript Library out of scope on Advanced Find

Posted on by 1,031

I have added a custom button that behaves quite nicely on the Lead home page. I also have the same button defined for sub-grids. The button appears on Advanced Find according to the specified Enable Rule. However the button does not respond when clicked. Looking in F12, the JavaScript library is not loaded. 

The library exists and is properly specified in Ribbon Workbench. Published. Re-published. Cleared cache. No luck.

pastedimage1608565484081v1.png

What am I missing? 

  • Suggested answer
    Clint Woods Profile Picture
    Clint Woods 1,031 on at
    RE: Ribbon Workbench - JavaScript Library out of scope on Advanced Find

    Ok, the code IS running after all. It appears a copy of my code (mc_person.js) gets copied else where (VM54231 in this case) at run time and is executing there. Break points set in mc_Person.js do nothing; debugger statements do work. I have not noticed this when debugging JavaScript before.  

    pastedimage1611247689237v1.png 

    The other issue seems to be that Xrm.Navigation.navigateTo does not work on the Advanced Find sub-grid even though it works on sub-grids on a form and the Home Page. 

  • Clint Woods Profile Picture
    Clint Woods 1,031 on at
    RE: Ribbon Workbench - JavaScript Library out of scope on Advanced Find

    Thanks @Prakesh for the suggestions. There is an enable rule which behaves properly. When 2 rows are selected on the Advanced Find page, the button is enabled as expected.

    pastedimage1608647181462v1.png

    The Command for the SubGrid is defined differently than the Command for the Home Page as the integer parameter varies between the two. I am not sure what else you are suggesting I check. Let me know

    pastedimage1608647331779v2.png

    I am actually seeing the Lead JavaScript library. I have the same test/issue going on with Contacts, so I think the issue is elsewhere. I will debug a bit more today and see what I come up with.

    thanks,
    clint

  • Clint Woods Profile Picture
    Clint Woods 1,031 on at
    RE: Ribbon Workbench - JavaScript Library out of scope on Advanced Find

    Thank you @Pravin for the suggestion. I am having mixed results. The button/script still work fine from the home page and I can confirm the debugger statement is in the Library. It does not change the behavior on the Advanced Find page. I launched F12 from the Advanced find, "empty cache and hard refresh". I am seeing the JavaScript library for the Leads (leads.js) but not for Contacts (contacts.js). I am adding the similar buttons to both entities... oops, I mean tables (LOL).  

    This does give me some additional things to look at. I'll debug a bit more today and see what I find. 

    regards,

    clint

  • RE: Ribbon Workbench - JavaScript Library out of scope on Advanced Find

    Hi,

    The custom button which you have created is specific to lead entity and also to application ribbon which appears globally. Enable rule has been implemented in application ribbon to display the button based on some condition?

    Can you please check parameter once because parameter differs for home, subgrid, form and application ribbon.

    Make sure to look into developer tools for any issues.

    If nothing works, put some alert or write something to console log.

    Regards,

    Prakash

  • Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: Ribbon Workbench - JavaScript Library out of scope on Advanced Find

    Can you please try once by adding "debugger" in your function. ?

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,647 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans