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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Ribbon button not triggering on demand workflow

(0) ShareShare
ReportReport
Posted on by

I an using Dynamics 365 online, and have created an On demand workflow(Raise CR):

8836.Workflow.PNG

I am trying to trigger this workflow from Ribbon button(Raise CR) added by me on Main form using Ribbon Workbench. 

When I manually run the workflow it works fine but when I click on the ribbon button nothing happens

below is the XML of ribbon:

<?xml version="1.0" encoding="utf-16"?>
<RibbonDiffXml xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:xsi="www.w3.org/.../XMLSchema-instance">
  <CustomActions>
    <CustomAction Id="infinity.new_baprequest.Button2.RaiseCR.CustomAction" Location="Mscrm.Form.new_baprequest.MainTab.Save.Controls._children" Sequence="45">
      <CommandUIDefinition>
        <Button Command="infinity.new_baprequest.Command0.CRCommand" Id="infinity.new_baprequest.Button2.RaiseCR" Image32by32="$webresource:Marketing/_images/MA/CopyAsCampaign_16.png" Image16by16="$webresource:Marketing/_images/MA/CopyAsCampaign_16.png" LabelText="$LocLabels:infinity.new_baprequest.Button2.RaiseCR.LabelText" Sequence="45" TemplateAlias="o2" ToolTipTitle="$LocLabels:infinity.new_baprequest.Button2.RaiseCR.ToolTipTitle" ToolTipDescription="$LocLabels:infinity.new_baprequest.Button2.RaiseCR.ToolTipDescription" />
      </CommandUIDefinition>
    </CustomAction>
    <HideCustomAction HideActionId="infinity.Mscrm.HomepageGrid.new_baprequest.Activate.Hide" Location="Mscrm.HomepageGrid.new_baprequest.Activate" />
    <HideCustomAction HideActionId="infinity.Mscrm.HomepageGrid.new_baprequest.Deactivate.Hide" Location="Mscrm.HomepageGrid.new_baprequest.Deactivate" />
    <HideCustomAction HideActionId="infinity.Mscrm.HomepageGrid.new_baprequest.Edit.Hide" Location="Mscrm.HomepageGrid.new_baprequest.Edit" />
    <HideCustomAction HideActionId="infinity.Mscrm.HomepageGrid.new_baprequest.NewRecord.Hide" Location="Mscrm.HomepageGrid.new_baprequest.NewRecord" />
    <HideCustomAction HideActionId="infinity.Mscrm.HomepageGrid.new_baprequest.NewRecordForBPFEntity.Hide" Location="Mscrm.HomepageGrid.new_baprequest.NewRecordForBPFEntity" />
  </CustomActions>
  <Templates>
    <RibbonTemplates Id="Mscrm.Templates" />
  </Templates>
  <CommandDefinitions>
    <CommandDefinition Id="infinity.new_baprequest.Command0.CRCommand">
      <EnableRules />
      <DisplayRules />
      <Actions>
        <JavaScriptFunction FunctionName="Mscrm.CommandBarActions.launchOnDemandWorkflowForm" Library="/_static/_common/scripts/CommandBarActions.js">
          <CrmParameter Value="PrimaryEntityTypeCode" />
          <StringParameter Value="0D69A285-FD02-46A8-9699-1265931D2C89" />
        </JavaScriptFunction>
      </Actions>
    </CommandDefinition>
  </CommandDefinitions>
  <RuleDefinitions>
    <TabDisplayRules />
    <DisplayRules />
    <EnableRules />
  </RuleDefinitions>
  <LocLabels>
    <LocLabel Id="infinity.new_baprequest.Button2.RaiseCR.LabelText">
      <Titles>
        <Title description="Raise CR" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="infinity.new_baprequest.Button2.RaiseCR.ToolTipTitle">
      <Titles>
        <Title description="CR" languagecode="1033" />
      </Titles>
    </LocLabel>
    <LocLabel Id="infinity.new_baprequest.Button2.RaiseCR.ToolTipDescription">
      <Titles>
        <Title description="Raise CR" languagecode="1033" />
      </Titles>
    </LocLabel>
  </LocLabels>
</RibbonDiffXml>

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    The scope of the workflow is set to user, this means it will only work for the user who created it. Change this to organization and see if it helps.

    Hope this helps.

  • Community Member Profile Picture
    on at

    I have changed scope to organization, still same issue

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    Didn't look  at your code before, It uses internal function which is unsupported and may not be available anymore Mscrm.CommandBarActions.launchOnDemandWorkflowForm

    You can use the smart button solution (along with RWB solution) which has a predefined button to call the workflow without any code. Refer below links-

    develop1.net/.../Smart-Buttons-in-the-Ribbon-Workbench

    www.develop1.net/.../Adding-Ribbon-Workbench-SmartButtons-to-the-Unified-Client

    ribbonworkbench.uservoice.com/.../896958-smart-buttons

    Hope this helps.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans