web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
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

I have the same question (0)
  • James AT Hallstudios Profile Picture
    on at

    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.

  • DFA Profile Picture
    100 on at

    No, unfortunately not.

    I use buttons instead of flyouts in the unified interface.

  • James AT Hallstudios Profile Picture
    on at

    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
    100 on at

    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"

  • Kumar Viju Profile Picture
    1,026 on at

    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
    100 on at

    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.

  • Suggested answer
    Kumar Viju Profile Picture
    1,026 on at

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

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans