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)

How to save HTML Form in web resource on submit button

(0) ShareShare
ReportReport
Posted on by

Screenshot-_2800_211_2900_.png

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Surender Vishwanatham Profile Picture
    255 on at

    Hi Afroz,

    You need to elaborate your query to get approprate answer.

    Is that your requirement is to call function that sits in your HTML webresource when user saves CRM form? If yes,

    You need to create a function in your HTML webresource lets name the function as "SaveRegistrationInfo".

    New create a JavaScript webresource with a function "Form_OnSave" and then add this webresource to your registration Form and call "Form_OnSave" function on save of the form.

    function Form_OnSave()

    {

    Xrm.Page.getControl("WebResource_<HTML Webresource name>").getObject().contentWindow.window.SaveRegistrationInfo();

    }

    Hope this works!

    Regards,

    Surender Vishwanatham

  • Suggested answer
    Dan Hesketh Profile Picture
    on at

    Hi mate,

    If I understand you correctly, you probably want to SAVE the data entered into your HTML form onSave.

    Also if the form is re-opened later, you'd want the Form to re-populate with the existing data.

    I have applied a similar technique before and I believe the best approach is as follows:

    This is high-level:

    1. Create a Multi-Line Text Field on your CRM Form (it can be hidden) to store the data

    2. Code your HTML form fields so that each <input> field etc calls your function eg. "saveItem()"

        This function will need to generate the entire form data (all fields) into a JSON Array

        and store it in the Multi-Line Text field above, overwriting anything there already.

    3. Setup your HTML to be "dynamic" in that onLoad it reads existing data from the JSON Array and populates the form again.

    A quick search surfaced this post from the amazing Paul Nieuwelaar @ Magnetism NZ. He goes into much more detail than me here. Different scenario, but same approach.

    http://www.magnetismsolutions.com/blog/paulnieuwelaar/2015/08/25/basic-html-rich-text-editor-for-microsoft-dynamics-crm-2015

    Hope this gives you some great ideas.

    P.S. I have a solution/app that uses similar techniques but for a Checklist/To-Do List.

    You can check it out on AppSource shortly, or www.miiia.com.au/add-ons

    Cheers,

    Dan

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