Hi Everyone,
We are using D365 Sales Online and recently got a requirement to create dialogs/prompts for a custom entity.
But, sInce Dialogs are deprecated, I am trying to figure out a way to create something similar using JavaScript?
Below are the Requirements:
Whenever Order (custom entity) record is created user should receive a dialog/prompt to confirm the order before saving the record.
- Prompt should have two options "Ok" and "Cancel"
- If the user hits "OK" the script should redirect the user to the related documents tab
- If the user hits "Cancel" record should "not be saved"
I tried the below code for the prompt but even if I hit cancel, it saves the record and a new order is being created. Also don't know how to add redirection to the documents tab.
function ConfirmBox() {
var confirmationText;
if (confirm("Would you like to proceed?")) {
confirmationText = "You pressed OK!";
} else {
confirmationText = "You pressed Cancel!";
}
//Using the alert notification to show the option selected
alert(confirmationText);
Thank you in advance for the help