Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Unexpected behavior for dynamically populated Flyout menu in Sales Hub, Customer Sales Hub, etc.

Posted on by 100

Hi,

 

I’m seeing some behavior in Sales Hub, Customer Sales Hub, etc., which I can’t explain.
So, I just want to know if I’m doing something wrong, or if this is expected behavior.

 

I’ve tried to simplify it as much as possible, so I just added a Flyout Anchor button in Ribbon Workbench which uses a Command for PopulateQueryCommand, which in turn calls a JS function with the CRM Parameter “CommandProperties”.

The JS function:

function flyoutPopulate(_commandProperties) {
	debugger;

	_commandProperties["PopulationXML"] =
	
	'<Menu Id="new.task.Button3.flyout.Menu">'
		+ '<MenuSection Id="new.task.Button3.flyout.Menu.Section" Sequence="10" DisplayMode="Menu16">'
			+ '<Controls Id="new.task.Button3.flyout.Menu.Section.Control">'
				+ '<Button Command="new.task.Command0.Click" Id="new.task.Button2.Button" CommandValueId="buttonTestValue2" LabelText="SomeButtonText" Sequence="1" ToolTipDescription="SomeButtonText" />'
			+ '</Controls>'
		+ '</MenuSection>'
	+ '</Menu>';
}

Result

I’m getting the following when clicking on the Flyout Anchor button in Sales Hub:

CRM_5F00_1.png

If I change the JS function, so that the button id is identical to the id of any other existing button (in this case “Test button”):

CRM_5F00_2.png

The button is displayed; however, it's command is not being executed.
The command is identical to that of the “Test button”, which works.

 

It also looks like that CommandValueId is not passed along in the CommandProperty (for static buttons).

 

Everything works in the standard “Sales”.

 

Thanks

*This post is locked for comments

  • Suggested answer
    Kumar Viju Profile Picture
    Kumar Viju 1,026 on at
    RE: Unexpected behavior for dynamically populated Flyout menu in Sales Hub, Customer Sales Hub, etc.

    DFA - Thank you. I was using wrong command ID. My Mistake. Thanks for pointing out.. It worked! ( WEB UI )

  • DFA Profile Picture
    DFA 100 on at
    RE: Unexpected behavior for dynamically populated Flyout menu in Sales Hub, Customer Sales Hub, etc.

    What are you seeing? Don’t you see the flyout at all? Or does it display ‘No options available’?

    And you are looking at an existing record (display-rule)?

    I tried adding your code to a CRM instance, and it seems to work fine as long as you have a command called 'mypub.phonecall.Command.Social' with the click event.

  • Kumar Viju Profile Picture
    Kumar Viju 1,026 on at
    RE: Unexpected behavior for dynamically populated Flyout menu in Sales Hub, Customer Sales Hub, etc.

    I am unable to even get the FLY OUT DYNAMIC MENU in normal Web Interface.

    I am using the below given script..Please can someone Let me know..What is the issue?

    function populateSocialMenu(commandProperties) {
    var commandId = 'mypub.phonecall.Command.Social';

    var menuXml = '<Menu Id="new.new_dslschema.Button18.Button.Menu">';
    menuXml += '<MenuSection Id="new.new_dslschema.Section19.Section" Sequence="10" DisplayMode="Menu16">';
    menuXml += '<Controls Id="new.new_dslschema.Section19.Section.Controls">';
    menuXml += '<Button Alt="Facebook" Command="' + commandId + '" Id="vrp.vrp_customerproduct.Button.FacebookButton" LabelText="Facebook" Sequence="10" TemplateAlias="o1" ToolTipTitle="Facebook" ToolTipDescription="Facebook" />';
    menuXml += '<Button Alt="Twitter" Command="' + commandId + '" Id="vrp.vrp_customerproduct.Button.TwitterButton" LabelText="Twitter" Sequence="20" TemplateAlias="o1" ToolTipTitle="Twitter" ToolTipDescription="Twitter" />';
    menuXml += '</Controls>';
    menuXml += '</MenuSection>';
    menuXml += '</Menu>';

    commandProperties["PopulationXML"] = menuXml;
    }

    function onSocialMenuItemClick(commandProperties) {
    debugger;
    alert(commandProperties.SourceControlId + ' clicked');

    }

    REF: www.kashanahmed.com/.../08

  • DFA Profile Picture
    DFA 100 on at
    RE: Unexpected behavior for dynamically populated Flyout menu in Sales Hub, Customer Sales Hub, etc.

    I seem to be able to display the buttons (Facebook & Twitter), however, the function onSocialMenuItemClick is never invoked in the unified interface (works fine in normal web based Sales).

    I might just have typed something wrong. Unfortunately, I have some higher priority work items at the moment, so I can’t really dig into it.

     

     

    Prefixing commands with entity-name, NoRelationship and Form seems correct, as the same is done on standard flyouts, like “Flow”, where the only difference is the command:

    UCI: Command="quote|NoRelationship|Form|Mscrm.Flows.TriggerFlow"

    Web: Command="Mscrm.Flows.TriggerFlow"

  • RE: Unexpected behavior for dynamically populated Flyout menu in Sales Hub, Customer Sales Hub, etc.

    Cheers.  I found this link which describes the same issue with a solution, but I cannot seem to get it to work yet.

    www.kashanahmed.com/.../08

  • DFA Profile Picture
    DFA 100 on at
    RE: Unexpected behavior for dynamically populated Flyout menu in Sales Hub, Customer Sales Hub, etc.

    No, unfortunately not.

    I use buttons instead of flyouts in the unified interface.

  • RE: Unexpected behavior for dynamically populated Flyout menu in Sales Hub, Customer Sales Hub, etc.

    Did you ever get a solution to this problem, I am experiencing the same thing.  Works fine in the classic Web Interface, but not in the Unified Interface.

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