Skip to main content

Notifications

Announcements

No record found.

Customer Service forum
Answered

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

Posted on by 459

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

Categories:
  • SivaR Profile Picture
    SivaR 459 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
    SivaR 459 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
    Goutham A 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
    Nya 29,054 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

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,246 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,041 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans