web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

if form validation failed, then forward to another page from Entity form in dynamics 365 portal

(0) ShareShare
ReportReport
Posted on by 63

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

pastedimage1632426985842v1.png

I have the same question (0)
  • SivaR Profile Picture
    63 on at
    RE: if form validation failed, then forward to another page from Entity form in dynamics 365 portal

    Thank you Nya. this helped me to resolve the issue.

  • SivaR Profile Picture
    63 on at
    RE: if form validation failed, then forward to another page from Entity form in dynamics 365 portal

    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

    pastedimage1632488226207v1.png

  • Suggested answer
    Goutham A Profile Picture
    2 on at
    RE: if form validation failed, then forward to another page from Entity form in dynamics 365 portal

    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>

  • Verified answer
    Nya Profile Picture
    29,060 on at
    RE: if form validation failed, then forward to another page from Entity form in dynamics 365 portal

    Hi,

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 100 Super User 2025 Season 2

#2
Suresh Kulla Profile Picture

Suresh Kulla 72 Super User 2025 Season 2

#3
DAnny3211 Profile Picture

DAnny3211 54

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans