Lloyd Plum Posted March 21, 2019 Share Posted March 21, 2019 Trying to execute the following code: for page in Document.Pages: if page.Title == pageName: Document.Pages.Remove(page) Without fail, this results in the program crashing. If I execute within the Ironpython scripting window, I get the following error (followed by a crash when I exit the scripting window): System.InvalidOperationException: Attempt to start ReadTransaction in state 'Detached'. at Spotfire.Dxp.Framework.DocumentModel.Node.ReadTransaction[T](ValueReader`1 valueReader) at Spotfire.Dxp.Application.WebView.DataPanelWebView.BuildColumnListState() at Spotfire.Dxp.Application.WebView.DataPanelWebView.UpdateAllListBoxes(Boolean rebuildColumnListState, Boolean resetScrollingAndAnchor) at Spotfire.Dxp.Framework.DocumentModel.ExternalThreadSafeEventHandlerConnection.RaiseNotUpToDateCallback() at Spotfire.Dxp.Framework.Commands.CommandHistory.RaiseNotUptoDateWorkPackages() at Spotfire.Dxp.Framework.Commands.CommandHistory.c__DisplayClass1.b__0() at Spotfire.Dxp.Forms.Application.FormsApplicationThread.InvokeOnUIThreadAndTransferTransactionStartPermission(ApplicationInvocation method) at Spotfire.Dxp.Framework.Commands.CommandHistory.CommitOutermostTransaction(Object busyProof, Boolean oldHiding, Boolean sticky, Guid stickyGuid) at Spotfire.Dxp.Framework.Commands.CommandHistory.OutermostTransactionHandle.PerformCommit() at Spotfire.Dxp.Framework.Commands.CommandHistory.Transaction(Executor executor, Boolean visible, Boolean sticky, Guid stickyGuid) at Spotfire.Dxp.Framework.Commands.CommandHistory.Transaction(String displayName, Executor executor) at Spotfire.Dxp.Application.Scripting.ScriptManager.ExecuteScriptForDebugging(String scriptCode, Dictionary`2 scriptArguments, String& output) at Spotfire.Dxp.Forms.Framework.Scripting.ScriptEditDialog.RunButton_Click(Object sender, EventArgs e) Version is 6.5.3 Link to comment Share on other sites More sharing options...
Khushboo Rabadia Posted March 27, 2019 Share Posted March 27, 2019 You should upgrade to latest versions as it does not crash in latest versions and also there is an option to execute script in transaction which is not present in 6.5 due to which it crashes as the page you might be deleting on the same page you might have your script in text area Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now