Introduction
In this article, we are going to discuss how we can display a success message with a back button on the Dynamics 365 portal web page once the record is submitted.
Requirement
Display a specific message after case submission with a back button to go back to the case list in the Dynamics 365 portal.
Solution
To implement the above requirement, we need to do the following two tasks.
- Configure entity form to display a success message.
- Add a Custom button to the case form.
For demo purposes, we are using the vanilla Dynamics 365 portal but you can follow similar steps in your portal. Let’s see how we can implement it.
Configure entity form to display a success message
- Navigate to Portals-> Entity Forms and open Customer Service – Create Case entity form.
- Change On Success Settings like below.
- Navigate to Additional Settings and add your Success Message.
- Save and Close your changes.
Add a Custom button to the case form
We are going to add the following button in our Case web template.
<input type="button" value="Back" onclick="onBackClick()" id="BackBtn" class="btn btn-primary"/>
We have added this code right below the entity form tag.
As we only want to show this when our success message is displayed, we have used the following check. To redirect back to the parent page we are using the liquid page object.
So, when we try to create a new case, this button will be hidden but once we submit a case, we will see our success message with a back button like below.
And, when we click this button it will redirect us to the case list.
Hope it will help someone!