Type: System.ArgumentException Message: Das Steuerelement der obersten Ebene kann nicht zu einem Steuerelement hinzugefügt werden. StackTrace: bei System.Windows.Forms.Control.ControlCollection.Add(Control value) bei Microsoft.Dynamics.Framework.UI.WinForms.ControlAddInPlaceholder.Initialize(Control c) bei Microsoft.Dynamics.Framework.UI.WinForms.ControlAddInAdapter.InitializeNativeControl(Object control) bei Microsoft.Dynamics.Framework.UI.Windows.LogicalControlAdapter.get_NativeControl() bei Microsoft.Dynamics.Framework.UI.Windows.LogicalControlAdapter.Build(Boolean childrenOnly) bei Microsoft.Dynamics.Framework.UI.Windows.LogicalControlAdapter.Build(Boolean childrenOnly) bei Microsoft.Dynamics.Framework.UI.Windows.LogicalControlAdapter.Build(Boolean childrenOnly) bei Microsoft.Dynamics.Framework.UI.Windows.LogicalControlAdapter.Build() bei Microsoft.Dynamics.Framework.UI.WinForms.FormHostControlAdapter.HandleFormHost() bei Microsoft.Dynamics.Framework.UI.WinForms.FormHostControlAdapter.OnPropertySwitch(PropertyChangedEventArgs& propertyChangedArgs, CancelEventArgs& cancelArgs) bei Microsoft.Dynamics.Framework.UI.WinForms.FormHostControlAdapter.OnPropertyChanged(Object sender, PropertyChangedEventArgs propertyChangedArgs, CancelEventArgs cancelArgs) bei Microsoft.Dynamics.Framework.UI.Windows.LogicalControlAdapter.PropertyChanged(Object sender, PropertyChangedEventArgs propertyChangedArgs) bei System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e) bei Microsoft.Dynamics.Framework.UI.LogicalControl.OnPropertyChanged(PropertyChangedEventArgs e) bei Microsoft.Dynamics.Framework.UI.FormHostControl.OnPropertyChanged(PropertyChangedEventArgs e) bei Microsoft.Dynamics.Framework.UI.FormHostControl.set_HostedForm(LogicalForm value) bei Microsoft.Dynamics.Framework.UI.UX2006.NavigationService.OpenEmbeddedForm(String formName) bei Microsoft.Dynamics.Framework.UI.UX2006.NavigationService.OpenEmbeddedForm(String formName, NavigationNode node) bei Microsoft.Dynamics.Framework.UI.UX2006.NavigateToFormAction.InvokeCore(Boolean async, LogicalControl logicalControl, Object state, UISession uiSession) bei Microsoft.Dynamics.Nav.Client.Actions.NavNavigateToFormAction.InvokeCore(Boolean async, LogicalControl logicalControl, Object state, UISession uiSession) bei Microsoft.Dynamics.Framework.UI.Action.InvokeCoreWithErrorHandling(Boolean async, LogicalControl logicalControl, Object state, UISession uiSession) bei Microsoft.Dynamics.Framework.UI.Action.DoInvoke(LogicalControl logicalControl, UISession uiSession) bei Microsoft.Dynamics.Framework.UI.Action.Invoke(LogicalControl logicalControl) bei Microsoft.Dynamics.Framework.UI.UX2006.NavigationService.NavigateToNode(LogicalControl logicalControl, NavigationNode node) bei Microsoft.Dynamics.Framework.UI.UX2006.NavigationPaneLogicalControl.OnNavigate(NavigationEventArgs e) bei Microsoft.Dynamics.Framework.UI.NavigationControlBase.Navigate(Object node) bei Microsoft.Dynamics.Framework.UI.WinForms.NavigationPaneControlAdapter.navigationPaneBarNavigate(Object sender, NavigationPaneNavigateEventArgs e) bei Microsoft.Dynamics.Framework.UI.WinForms.Controls.NavigationPaneTreeTab.OnNavigate(NavigationPaneNavigateEventArgs e) bei Microsoft.Dynamics.Framework.UI.WinForms.Controls.NavigationPaneTreeTab.treeView_Navigate(Object sender, NavigationNodeEventArgs e) bei Microsoft.Dynamics.Framework.UI.WinForms.Controls.NavigationPaneTreeView.OnNodeSelected(NavigationNodeEventArgs e) bei Microsoft.Dynamics.Framework.UI.WinForms.Controls.NavigationPaneTreeView.navTreeNode_Selected(Object sender, EventArgs e) bei Microsoft.Dynamics.Framework.UI.WinForms.Controls.NavigationPaneTreeView.NavTreeNode.OnSelected(EventArgs e) bei Microsoft.Dynamics.Framework.UI.WinForms.Controls.NavigationPaneTreeView.NavTreeNode.Select() bei Microsoft.Dynamics.Framework.UI.WinForms.Controls.NavigationPaneTreeView.NavTreeNode.OnClicked(MouseLocationEventArgs e) bei Microsoft.Dynamics.Framework.UI.WinForms.Controls.NavigationPaneTreeView.OnMouseUp(MouseEventArgs e) bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) bei System.Windows.Forms.Control.WndProc(Message& m) bei Microsoft.Dynamics.Framework.UI.WinForms.Controls.NavigationPaneTreeView.WndProc(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Source: System.Windows.Forms
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Drawing; using Microsoft.Dynamics.Framework.UI.Extensibility; using Microsoft.Dynamics.Framework.UI.Extensibility.WinForms; namespace my_Form { [ControlAddInExport("FORM")] public class Class1 : WinFormsControlAddInBase { protected override Control CreateControl() { Form1 my_form = new Form1(); my_form.Size = new Size(600, 400); return my_form; } } }
Answers
You have only two ways how to pass data between NAV and Addin - the field value (NAV to Addin and back) and the Addin Event (Addin to NAV). If the field is BLOB, you can pass what you want inside it like XML etc.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.