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)

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

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