Hi,
I am using an Entity form with three questions. If users select No for any of the questions on the portal page, It will forward them to another page that displays an error message and some links for guidance.
I am trying to achieve this by adding javascript validation on the entity form (Additional setting - custom javascript) (refer to image 1). if the validation fails, then I want to forward it to another page.
I try to follow this link. https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/add-custom-javascript#additional-client-side-field-validation
however, i don't know where to add forwarding to the new page code. Could you please advise me how i can prevent the form submission and forward to another page when the user selects "No" for any of the questions?
Thank you, Siva
image 1
Thank you Nya. this helped me to resolve the issue.
Thank you Gowtham for the response. i am trying to apply the validation in the Entity Form on the Portal site. Your suggestion works for CRM form.
Here is the portal form. if any of the options box is selected with "No", the page needs to be forwarded to the "Not eligible" page. Thank you, Siva
To avoid form submission, you should not have any dirty fields in current form. However, i see you were changing some fields(questioners) which makes the page dirty and based on the field input you are navigating to different page. I believe you were doing this on field change or save. So, you may need to add additional condition here before navigating->set submit mode of modified or all the fields to never.(may need to loop through all fields and check if dirty, then set submit mode to never) Some references below..
docs.microsoft.com/.../getisdirty
carldesouza.com/.../
Another way of achieving this requirement is to have different sections in same form and show or hide sections\tabs based on field values...
<Please mark my answer if it solves your query>
Please refer to the following post:
(+) Dynamics Portals: Adding a custom button to the entity forms - Microsoft Dynamics CRM Community
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Mansi Soni as our August 2025 Community…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Abhilash Warrier 100 Super User 2025 Season 2
Suresh Kulla 72 Super User 2025 Season 2
DAnny3211 54