SBX - Search With Button

SBX - Forum Post Title

How to Submit two entity forms rendered on same web template

Microsoft Dynamics CRM Forum

AshokGinjupalli asked a question on 17 Sep 2018 11:06 PM

Question Status

Suggested Answer

Hi All,

we have a requirement in which 2 entity forms from different entities to be rendered on same web Template. Both entity forms will have multiple tabs to fill. We are hiding the OOB Submit buttons of both entity forms and using a custom Button to submit the data from both forms to CRM. For this, we are using a method to call the click event of both entity forms on Custom button click. We are facing some problem here. Data is not saving to CRM every time we click the Custom button. Sometimes it saves and sometimes it does not. 

Reply
Leo Zhang responded on 18 Sep 2018 2:23 AM
My Badges

Hi partner,

Did you customize a plug-in on server to execute the operation after clicking the button?

You can debug your code step by step and check for program issues or logical conflicts.

Hope it helps.

Best Regards

Leo

Reply
Mahender responded on 18 Sep 2018 5:00 PM
My Badges

Hi Ashok,

It may be the steps you are trying to do is not executing in similar manner all the time, did you try to put alert using js and see when you click on the button it display them correctly and you can debug you js code to see if it's executing steps correctly.

Reply
Dmytro Rutkovskyi responded on 19 Sep 2018 1:18 PM
My Badges

Entity forms is not designed to allow multiple instances on the same page.

I suggest create another empty page (page template without header/footer) with only second entity form and include it into first web-template as iframe.

And on submit trying to submit both forms. (inner and than original).

Reply
Macoy responded on 20 Sep 2018 10:17 PM
My Badges
Suggested Answer

Hi,

In your custom button, trigger the submit of the forms like below

$("#mycustomButton").click(function() {

 //you can insert additional logic here prior to calling below actions

 $("#Form1_id").submit();

 $("#Form2_id").submit();

});

Regards,

Macoy

Reply
Gani1212 responded on 16 May 2019 11:57 AM

Hi Macoy,

I am new to development. How to get Form1_id and Form2_id here.

Reply
Macoy responded on 20 Sep 2018 10:17 PM
My Badges
Suggested Answer

Hi,

In your custom button, trigger the submit of the forms like below

$("#mycustomButton").click(function() {

 //you can insert additional logic here prior to calling below actions

 $("#Form1_id").submit();

 $("#Form2_id").submit();

});

Regards,

Macoy

Reply

SBX - Two Col Forum

SBX - Migrated JS