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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Run js function from Ribbon

(0) ShareShare
ReportReport
Posted on by 94

Hello ,

I have two buttons in home of incident and I open the same form with the two buttons, the only difference is the  value to pass it : if the departement have number 1(Customer Relationship) I hide the section of ticket and if the departement is 2 (Support).

My problems are in the ribbon ,when I put two javascript function  to have the right form , one function (XrmCore.Commands.Open.openNewRecord  to open the form )is executed and the not function in js file.

I try it with local storage no solution also when I try whith function whith consol.log I don't have any results

Thank's2-buttons-_2B00_details-of-command_2B00_the-two-javascript-function.png

2-buttons-_2B00_details-of-command_2B00_the-two-javascript-function.png

*This post is locked for comments

I have the same question (0)
  • Dynamics Objects 365 Profile Picture
    550 on at

    I can see two custom js actions in the command in the screenshot. According to the screenshot XrmCore.Commands.Open.openNewRecord should trigger first as it is the first custom js action.

  • semosby Profile Picture
    230 on at

    Your images show the Open command running first.  When the open command runs a new form is opened and the subsequent command will not run unless it is in the On Open event of the form.

    If you're trying to hide/show different buttons on the form, you'll have to adjust your enable rules accordingly which could be based on the same field used in the section hiding.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Why not you declare one function and include all logic there  and register  one action only. Doing one function there is an advantage, you can debug and see where it's going .

  • RaviKashyap Profile Picture
    55,410 Moderator on at

    Plus  1 for Goutam's suggestion. You can call XrmCore.Commands.Open.openNewRecord from your custom method before your logic.

  • feninzie Profile Picture
    94 on at

    The probleme that I'm in the home page of the entity and the only function that works is "XrmCore.Commands.Open.openNewRecord" that open the form and when I associate a function in js file it's not running

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans