Using Custom JavaScript field on Entity Form to add JavaScript in Portal in Dynamics 365

Suppose we have added an Entity Form on Portal to display Lead information to the portal.

Now we want to add some JavaScript to it. For this we can use the Custom JavaScript field in Additional Settings tab of Entity Form.

We can make use of jQuery for this. The above code shows alert and also accesses the Topic field of Lead record using the schema name subject.

Alert Message –

Setting field value –

More details below

Hope it helps..


Using Entity Form to show CRM Form inside Portal in Dynamics 365

To show CRM Form inside Portal, go to CRM – Portal – Entity Form and let us create a new Entity Form record to show Lead form in Portal.

Here we have selected entity as lead and we are showing Summary Tab in the Lead form in insert mode in the Community Portal.

Now login to the portal with admin rights and create a new child page to display this lead form.

This adds the tab in the Portal page

Clicking on Submit shows the message

Opening CRM – Leads, we can see our lead record created.

Hope it helps.