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 365 | Integration, Dataverse...
Suggested Answer

How to add save button on form

(0) ShareShare
ReportReport
Posted on by 387

I feel like this should be easy...

We use Dynamics 365, I have a form with a multiline text field.

I would like to have a save button next to it that the end user can press that saves the form.

Yes I know I can tell them to use the 'button' on the bottom right of the screen... but end users like  big visible buttons.  Anyway.

I created a web resource html button that calls a function.

Created the jscript resource with basic save code.

I have added the jscript as a library on form properties.

I have added the webresource button on the form.

saved/published...

But nothing happens when I press the button.

Using the inspector I can see it was saying somethign about running scripts had not been enabled??  Googled it and somehow made that go away, but still getting error.

Couple weird things, in my html dynamics keeps adding something about emails every time I save it.  Then when the button fails says that is not an option.

So, I know first response is going to be 'post your code'... lol.  But honestly I have rewritten things so many times and tried so many things not sure that helps.

I'm assuming some one has already done this and can point me tot he instructions.

OR...

Is there a different option?

Also, what I didn't mention is I have a Microsoft Flow tied to when a record is updated... so need the button to kick off the flow.

Thanks,

Terry

I have the same question (0)
  • Suggested answer
    ba365guy Profile Picture
    2,950 on at

    Have a look at this link and the video in the link. This might help.

    pcf.gallery/.../

  • Suggested answer
    SErf Profile Picture
    659 on at

    In the new update the Save button on the top left will be enabled by default.

    docs.microsoft.com/.../save-always-visible-command-bar-edit-forms

    I would suggest you wait for the new update instead of spending resources on this.

    I do understand that users like big Save buttons but you can educate that Dynamics Autosaves everything when navigating away from a record or that they can use Ctrl. + S to save.

    You also have to load the WebResource on the form and not only add the library.

    In the window where you add the WR to the form you can execute it in the OnLoad method.

    Still, I'd suggest you wait it out.

    Good day!

  • Mattw112b Profile Picture
    387 on at

    Hi,

    I have imported this solution and added the control as shown in the video and instructions.  I have the button showing on my form, I have set the onchange fields to run a js function of a library I load on the form...  but when I click the button nothing happens.  No errors, nothing.  I have tried redoing this several times.  In the developer debugger in the browser I also see nothing when I click on the button.

    Any one actually having this work right now?  Can't figure out why it wouldn't be firing.

    Thanks,

    Terry

  • Mattw112b Profile Picture
    387 on at

    PS - I just changed my JS code to:

    alert( 'Hello, world!' );

    saved/published...

    Refreshed my form and this instantly fired onload??  But I don't have this set to fire on load?  I only have it tied to OnChange specifically on my button?

    Annotation-2020_2D00_02_2D00_02-145041.png

    Terry

  • Suggested answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    I also tried the PCF control mentioned above and I found that there's some uncertainty about its trigger condition. I add the JS code to onchange event and only triggered successfully few times.

    pastedimage1580711031564v1.png

    pastedimage1580711057987v2.png

    It doesn't always succeed. Maybe I didn't have the right configuration somewhere.

    Then I tried another way, I added an HTML page to show the save button on the form and it worked well.

    1.Create an HTML with save method JS to show the save button which you want to put on the form.

    pastedimage1580711551609v3.png

    2.Add the HTML into the form as a web resource.

    pastedimage1580711580765v4.png

    3.Save and publish. Let's have a try.

    pastedimage1580711674566v5.png

    Done!

    You could also refer to this blog.

    https://mscrmtutorials.com/create-a-custom-html-button-in-dynamics-365/

    Hope it helps.

    Best Regards,

    Leo

  • Mattw112b Profile Picture
    387 on at

    I cannot get the pcf control to work... I've followed instructions and done it a million times but never does anything.

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    You could try my ways in my last answer, I used web resource without any third-party tools.

    Regards,

    Leo

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 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 46 Most Valuable Professional

#2
Pallavi Phade Profile Picture

Pallavi Phade 33

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 28 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans