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)

Getting error trying to trigger JavaScript "on change" event with workflow

(0) ShareShare
ReportReport
Posted on by 803

I have a javascript that runs on the "appointment" entity. It gets the contact ID, makes an API call to a table related to Contact, pulls out some records from there, and then combines the information to create a "message" that we send to the contact prior to their appointment (like an appointment reminder with some extra details in it). We have been manually creating this message, but now are wanting to automate it being created in Dynamics, and then we can copy/paste it to send to the Contact. This would save a lot of time, as many of these messages go out everyday. 

I have some javascript that is triggered on a field change, and it all works fine when I have the form open. I was hoping I could simply set up a workflow to change the field that triggers the javascript, and thus run the script on multiple contact records at once from a grid view. However, when I select contacts from a view and run the workflow, the javascript doesn't fire. 

I also tried making it an editable grid view, adding the field that triggers the script and changing this field from the editable grid, but that doesn't fire the script either. 

Now I'm feeling like maybe I need to attach the script to a button on the ribbon. However, that will require rewriting much of the code, so I wanted to make sure there isn't an easier way before going down that road. 

Any thoughts on what can be done?

*This post is locked for comments

I have the same question (0)
  • Ben T Profile Picture
    803 on at

    Would really appreciate any thoughts on this one. My gut says I need to rewrite it to work with a button on the ribbon. To be clear, what I need to do is select a bunch of records and press a button or run a workflow to have my javascript code (which is working on the form) run and update a field value.

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