Example - Create a Form
You can add as many forms as you like to every single Content Node. Your form can be prepopulated with Dynamics data and can map to Dynamics records.
In this article we will create a sample form, which will be capturing end user request for receiving product sample and create new Opportunity in Dynamics.
We will start with creating new content like we did in the previous example but call it 'Request for Sample' this time.
We will not create any Dynamics queries, because our form will not require any data to be prefilled.
- To start creating a form, scroll to Dynamics Forms section and click 'Add Content':
Give your new form a name - 'RequestForSampleForm' and click Save:
Let's add the following fields to the form
- header saying 'Request for free sample'
- radio group to select one of 3 sample products (plastic case, wooden case, metal case)
- number field estimated budget
- radio group to select Purchase Process (Individual/Comittee) (with values of each option matching Dynamics optionset values)
- Go to submission settings and set:
- Target Type to Entity
- Target Entity to Opportunity
- Leave Upload File Attachments unticked as we don't intend to submit any files in this form
- Redirect To field to Home, so that after form submission user got redirected to main page. You can create custom Content Node with thank you message and redirect to it in real scenario
- Go to Submission Mappings and add mappings as per below:
Functions can be composed with function editor (see more details in previous article):
Scroll down to the content editor and add new single column row. Select 'Dynamics Form' type of content:
In the dropdown select the name of your form - this allows you to position form you created, in the grid layout.
Save and publish - when you refresh the front page you will see that filling in the form creates new opportunity in your linked Dynamics instance
Note that your Dynamics instance may have some additional logic on top of Opportunity entity like required fields or sychronous plugins, which may require you to pass more or different data in mappings. This example was created against vanilla Dynamics instance with Sales solutions installed.
Video
See the video how that has been configured: