Got "Leave site? Changes you made may not be saved." message when I tried to close Sales Order page
I added a action button in Sales Order page, after clicking this action button, it will popup a modal page. On this modal page, I added iframe and src is a third-party page through business central's controladdin object. This third-party page has a form, it has a textbox and submit button in the form. But after I submitted form data and closed modal page, if I click Back Arrow on Sales Order page, the following screenshot's message popuped.
If I continue to click 'Leave' button, business central seems to reset itself. It seems some issues happened. I don't want to show this message box and reset business central. Could anyone can help me to look into this issue? Is business central's itself issue?
My Business Central version is 14.0.29530.31705 and AL version is 3.0.145997
Following is my detailed code: Control Add-In object code: controladdin MyCrlAddInDemo { Scripts = 'https://code.jquery.com/jquery-2.1.0.min.js', 'Scripts/main.js'; StartupScript = 'Scripts/start.js';
RequestedWidth = 800;
RequestedHeight = 450;
MinimumWidth = 800;
MinimumHeight = 450;
MaximumWidth = 800;
MaximumHeight = 450;
HorizontalShrink = true;
VerticalShrink = true;
HorizontalStretch = true;
VerticalStretch = true;
event ControlReady()
procedure OpenPage()
}
start.js code: Microsoft.Dynamics.NAV.InvokeExtensibilityMethod("ControlReady", []);
main.js code: function OpenPage() { $('#controlAddIn').html("
");}
Modal page code: page 50100 myIframePage { PageType = StandardDialog; ApplicationArea = All; UsageCategory = Administration; Editable = false;
layout
{
area(Content)
{
usercontrol(myPage; MyCrlAddInDemo)
{
ApplicationArea = All;
trigger ControlReady()
begin
CurrPage.myPage.OpenPage();
end;
}
}
}
}
Extended Sales Order Page code: pageextension 50100 SalesOrderExt extends "Sales Order" { layout { // Add changes to page layout here }
actions
{
// Add changes to page actions here
addlast("P&osting")
{
action("Test")
{
ApplicationArea = All;
trigger OnAction()
var
myIframePage: Page myIframePage;
begin
myIframePage.Run();
end;
}
}
}
}
My HTML code in iframe:
<form id="submitFm" action="/TestSite/Home/TestPOST" method="post" novalidate="novalidate">
<input id="txtnName" name="txtnName" type="text" value="">
<input type="submit" value="OK">
</form>
Let's get the issue to a team who will fix and backport it, as this repo is only for issues related to the latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.
To open a support case, you can:
- Open a support request to CSS through the PartnerSource portal
- Contact your Service Account Manager (SAM) in your local subsidiary to understand what is included in your contract as of support incident and PAH (Partner Advisory Hours). Your SAM might also direct you "step by step" how to open a support request or how to get credentials, if this is the first time for you or your company
If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.