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 Fulfill Salesorder button not working

(0) ShareShare
ReportReport
Posted on by

Hi All,

I am currently experiencing a problem with my ribbon button "FulFill Order". It was working before but I am not sure what might have happened.

Note: It is passing an int parameter, because currently in the Microsoft CRM 2016, the savemode is not exactly working... I am using the int to replicate it.

Here is the XML:

<CommandDefinition Id="Mscrm.Form.salesorder.FulfillOrder">
<EnableRules>
<EnableRule Id="Mscrm.FormStateNotNew" />
</EnableRules>
<DisplayRules>
<DisplayRule Id="Mscrm.CanWritePrimary" />
<DisplayRule Id="Mscrm.IsBackOfficeNotInstalled" />
</DisplayRules>
<Actions>
<JavaScriptFunction FunctionName="fulfillOrder" Library="/_static/sfa/salesorder/salesorder.js" />
<JavaScriptFunction FunctionName="fulfillOrderRibbonButton" Library="$webresource:va_CheckIfActiveOrInactiveRecord">
<IntParameter Value="56" />
</JavaScriptFunction>
</Actions>
</CommandDefinition>

Any insights would be much appreciated.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I would suggest to take uncustomized instance of CRM and compare ribbon commands with yours.

    Also doublecheck that your custom fulfillOrderRibbonButton function works properly.

  • Community Member Profile Picture
    on at

    Hi Andrew,

    I jut happened to do that before posting. I even gave it the same enable rules, actions and display rules (except of the fulfillOrderRibbonButton function). Furthermore, I even went forward and took out the function.

    Here is the XML:

       <CommandDefinition Id="Mscrm.Form.salesorder.FulfillOrder">

         <EnableRules>

           <EnableRule Id="Mscrm.SalesorderIsActive" />

           <EnableRule Id="Mscrm.FormStateExisting" />

         </EnableRules>

         <DisplayRules>

           <DisplayRule Id="Mscrm.CanWritePrimary" />

           <DisplayRule Id="Mscrm.IsBackOfficeNotInstalled" />

         </DisplayRules>

         <Actions>

           <JavaScriptFunction FunctionName="fulfillOrder" Library="/_static/sfa/salesorder/salesorder.js" />

         </Actions>

       </CommandDefinition>

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Ok. What happened when you reverted state to initial?

  • Community Member Profile Picture
    on at

    Hi Andrew,

    So I attempted the following:

    1) I set it back to the original, using a test organization with a working "Fulfill" button (did not work)

    2) Took out the custom Javascript (did not work)

    3) Decided to confirm that it was not due to the custom Javascript by using an alert function to display when the button was pressed (The function works fine)

    4) I decided to check the button itself to see if the command was there or not. Surprisingly , it was not there at the beginning (facepalm), I kinda assumed it was. Then I added it and published it again and it still did not work ( I made sure to press publish all customizations too and it still did not work)

    I kinda ran out of ideas.

    Thanks though for your input Andrew, much appreciate it.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    I'm too old to believe in miracles.

    I compared your definition to what I have on my system and everything looks correct except your custom function piece. Try to remove it and test it again. Don't forget to add reference to command into button.

  • Community Member Profile Picture
    on at

    Hi Andew,

    I have taken the custom function and added the command to the button, still no results. When I press the button. nothing pops up. Here is the full XML:

    <RibbonDiffXml>

     <CustomActions>

       <CustomAction Id="va.Mscrm.Form.salesorder.FulfillOrder.CustomAction" Location="Mscrm.Form.salesorder.MainTab.Actions.Controls._children" Sequence="10">

         <CommandUIDefinition>

           <Button Alt="$Resources:Ribbon.Form.salesorder.MainTab.Actions.salesorder.FulfillOrder" Command="Mscrm.Form.salesorder.FulfillOrder" Id="Mscrm.Form.salesorder.FulfillOrder" Image32by32="/_imgs/SFA/FulfillOrder_32.png" Image16by16="/_imgs/SFA/FulfillOrder_16.png" LabelText="$Resources:Ribbon.Form.salesorder.MainTab.Actions.salesorder.FulfillOrder" Sequence="10" TemplateAlias="o2" ToolTipTitle="$Resources:Mscrm_Form_salesorder_MainTab_Actions_FulfillOrder_ToolTipTitle" ToolTipDescription="$Resources:Mscrm_Form_salesorder_MainTab_Actions_FulfillOrder_ToolTipDescription" />

         </CommandUIDefinition>

       </CustomAction>

     </CustomActions>

     <Templates>

       <RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>

     </Templates>

     <CommandDefinitions>

       <CommandDefinition Id="Mscrm.Form.salesorder.CancelOrder">

         <EnableRules>

           <EnableRule Id="Mscrm.FormStateNotNew" />

           <EnableRule Id="Mscrm.salesorder.CanOrderBeCancelled" />

         </EnableRules>

         <DisplayRules>

           <DisplayRule Id="Mscrm.CanWritePrimary" />

         </DisplayRules>

         <Actions>

           <JavaScriptFunction FunctionName="closeOrder" Library="/_static/sfa/salesorder/salesorder.js" />

           <JavaScriptFunction FunctionName="cancelOrderRibbonButton" Library="$webresource:va_CheckIfActiveOrInactiveRecord">

             <IntParameter Value="26" />

           </JavaScriptFunction>

         </Actions>

       </CommandDefinition>

       <CommandDefinition Id="Mscrm.Form.salesorder.FulfillOrder">

         <EnableRules>

           <EnableRule Id="Mscrm.FormStateExisting" />

           <EnableRule Id="Mscrm.SalesorderIsActive" />

         </EnableRules>

         <DisplayRules>

           <DisplayRule Id="Mscrm.CanWritePrimary" />

           <DisplayRule Id="Mscrm.IsBackOfficeNotInstalled" />

         </DisplayRules>

         <Actions>

           <JavaScriptFunction FunctionName="fulfillOrder" Library="/_static/sfa/salesorder/salesorder.js" />

         </Actions>

       </CommandDefinition>

       <CommandDefinition Id="Mscrm.ReportMenu.Form">

         <EnableRules>

           <EnableRule Id="Mscrm.FormStateNotNew" />

           <EnableRule Id="va.salesorder.EnableRule0.EnableRule" />

         </EnableRules>

         <DisplayRules>

           <DisplayRule Id="Mscrm.ReadReport" />

         </DisplayRules>

         <Actions />

       </CommandDefinition>

     </CommandDefinitions>

     <RuleDefinitions>

       <TabDisplayRules />

       <DisplayRules>

         <DisplayRule Id="Mscrm.CanWritePrimary">

           <EntityPrivilegeRule PrivilegeType="Write" PrivilegeDepth="Basic" AppliesTo="PrimaryEntity" />

         </DisplayRule>

         <DisplayRule Id="Mscrm.IsBackOfficeNotInstalled">

           <OrganizationSettingRule Setting="IsSOPIntegrationEnabled" InvertResult="true" />

         </DisplayRule>

         <DisplayRule Id="Mscrm.ReadReport">

           <EntityPrivilegeRule PrivilegeType="Read" PrivilegeDepth="Basic" EntityName="report" />

         </DisplayRule>

       </DisplayRules>

       <EnableRules>

         <EnableRule Id="Mscrm.FormStateExisting">

           <FormStateRule State="Existing" />

         </EnableRule>

         <EnableRule Id="Mscrm.FormStateNotNew">

           <FormStateRule State="Create" InvertResult="true" />

         </EnableRule>

         <EnableRule Id="Mscrm.salesorder.CanOrderBeCancelled">

           <OrRule>

             <Or>

               <CustomRule FunctionName="isSalesorderFulfilled" Library="/_static/SFA/salesorder/salesorder.js" />

               <CustomRule FunctionName="isBackOfficeInstalled" Library="/_static/SFA/salesorder/salesorder.js" InvertResult="true" />

             </Or>

             <Or>

               <CustomRule FunctionName="isSalesorderSubmitted" Library="/_static/SFA/salesorder/salesorder.js" />

               <CustomRule FunctionName="isBackOfficeInstalled" Library="/_static/SFA/salesorder/salesorder.js" />

             </Or>

             <Or>

               <CustomRule FunctionName="isSalesorderActive" Library="/_static/SFA/salesorder/salesorder.js" />

             </Or>

           </OrRule>

         </EnableRule>

         <EnableRule Id="Mscrm.SalesorderIsActive">

           <CustomRule FunctionName="isSalesorderActive" Library="/_static/SFA/salesorder/salesorder.js" />

         </EnableRule>

         <EnableRule Id="va.salesorder.EnableRule0.EnableRule">

           <CustomRule FunctionName="enableSaveButton" Library="$webresource:va_I_and_A_js" Default="false" />

         </EnableRule>

       </EnableRules>

     </RuleDefinitions>

     <LocLabels />

    </RibbonDiffXml>

  • Community Member Profile Picture
    on at

    I just did an interesting test. I sent my ribbon to my testing organization and it still works.

    I believe something must be off with : <JavaScriptFunction FunctionName="closeOrder" Library="/_static/sfa/salesorder/salesorder.js" />

    I am currently on 8.1.1.1005.

    Any ideas on how would I check or debug that file?

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    You can debug it using the same approach like standard one. The main difference that you can't add debugger; directive inside but you still can set breakpoints inside.

  • Verified answer
    Community Member Profile Picture
    on at

    Hi,

    Sorry for the later reply.

    Me and my colleague eventually went and even tested past versions of the deployment files and changed the deployment files from a working organization and it did not work. Eventually, we just replaced it with a workflow.

    Thanks for your time!

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