hello all, we are facing a problem including some b1s forms inside class libraries.
we are developing 2 different addins, both of which include the same user defined form.
in a normal development environment we would simply create a class library with the user defined form to be shared between projects, then add a reference to this library in both addins and go for it.
too bad nothing is working, every time we try to open the form we face the dreadful "Failed to create form. Please check the form attributes." error.
obviously we are missing something, i just cannot believe it's not possibile to include user defined forms in a library.
by the way here are the details:
- vs2012 ide, c# language, fw4.5, sdk sap b1 9.1 (SAPBusinessOneSDK.dll)
- addin project and class library x86
i built a sample to show the error, there is only one form in the addin solution with a button that opens a b1f form included in the referenced class library
we're always facing this error.
now i'm conscious that there's something wrong in the generated b1s file, as it is missing in the VSIcreated section the class library form, but even if i add it i just can't instance the form
<?xml version="1.0" encoding="utf-16" standalone="yes"?> <projects> <project name="{b4ea8f89-3a15-482a-add0-aef8f6cfd572}" type="Add-on"> <file name="Form1.b1f" type="UserForm" time="18/04/2016 12:32:41"> <content desc="<?xml version="1.0" encoding="UTF-16" standalone="yes"?><form Top="10" Left="10" Width="300" Height="300" AutoManaged="False" DefaultButton="" FormType="-1" BorderStyle="0" Color="0" Pane="1" Mode="1" ObjectType="" Client_Height="" Client_Width="" Settings_GridItemUID="" Enabled="False" EnableRowFormat="False" BrowseBy="" Title="New Form 1" Visible="False" UniqueID=""><datasources /><item Top="25" Left="22" Width="252" Height="181" AffectsFormMode="True" Description="" DisplayDesc="False" Enabled="True" FromPane="0" ToPane="0" LinkTo="" RightJustified="False" Type="4" Visible="True" UniqueID="Item_0" IsAutoGenerated="False"><specific Caption="Open a form in another library" /></item><FormCategory type="UserForm" /></form>" /> </file> </project> <project name="{b1de0e88-7aed-4c0d-b63b-fc2c7f456e67}" type="Add-on"> <file name="Forms/FormInLibrary.b1f" type="UserForm" time="18/04/2016 10:58:13"> <content desc="<?xml version="1.0" encoding="UTF-16" standalone="yes"?><form Top="10" Left="10" Width="300" Height="300" AutoManaged="False" DefaultButton="" FormType="-1" BorderStyle="0" Color="0" Pane="1" Mode="1" ObjectType="" Client_Height="" Client_Width="" Settings_GridItemUID="" Enabled="False" EnableRowFormat="False" BrowseBy="" Title="New Form 1" Visible="False" UniqueID=""><datasources /><item CellHeight="16" TabOrder="0" TitleHeight="20" Top="26" Left="21" Width="150" Height="150" AffectsFormMode="True" Description="" DisplayDesc="False" Enabled="True" FromPane="0" ToPane="0" LinkTo="" RightJustified="False" Type="127" Visible="True" UniqueID="Item_0" IsAutoGenerated="False"><specific MatrixLayout="0" SelectionMode="0" /><Column BackColor="16777215" ChooseFromListAlias="" ChooseFromListIsAutoFill="False" ChooseFromListUID="" FontSize="-1" ForeColor="-1" TextStyle="0" DisplayDesc="False" Visible="True" AffectsFormMode="True" ValOn="Y" IsAutoGenerated="False" ValOff="N" Description="" Title="#" Width="25" Editable="True" Type="16" RightJustified="False" UniqueID="#" Sortable="False"><databind DataSource="" Databound="False" TableName="" Alias="" /></Column><Column BackColor="-1" ChooseFromListAlias="" ChooseFromListIsAutoFill="False" ChooseFromListUID="" FontSize="-1" ForeColor="-1" TextStyle="0" DisplayDesc="False" Visible="True" AffectsFormMode="True" ValOn="Y" IsAutoGenerated="False" ValOff="N" Description="" Title="Col_0" Width="50" Editable="True" Type="16" RightJustified="False" UniqueID="Col_0" Sortable="False"><databind DataSource="" Databound="False" TableName="" Alias="" /></Column></item><item Top="230" Left="26" Width="65" Height="20" AffectsFormMode="True" Description="" DisplayDesc="False" Enabled="True" FromPane="0" ToPane="0" LinkTo="" RightJustified="False" Type="4" Visible="True" UniqueID="Item_1" IsAutoGenerated="False"><specific Caption="Button1" /></item><item Top="230" Left="94" Width="65" Height="20" AffectsFormMode="True" Description="" DisplayDesc="False" Enabled="True" FromPane="0" ToPane="0" LinkTo="" RightJustified="False" Type="4" Visible="True" UniqueID="Item_2" IsAutoGenerated="False"><specific Caption="Button2" /></item><FormCategory type="UserForm" /></form>" /> </file> </project> <project name="VSIcreated" type="VSIBuilt"> <file name="Form1.b1f" type="UserForm"> <content desc="<?xml version="1.0" encoding="UTF-16"?><Application><forms><action type="add"><form appformnumber="-1" FormType="-1" type="0" BorderStyle="0" uid="" title="New Form 1" visible="0" default_button="" pane="1" color="0" left="10" top="10" width="300" height="300" client_width="" client_height="" AutoManaged="0" SupportedModes="15" ObjectType="" mode="1"><datasources><DataTables /><dbdatasources><action type="add" /></dbdatasources><userdatasources><action type="add" /></userdatasources></datasources><Menus /><items><action type="add"><item top="25" left="22" width="252" height="181" AffectsFormMode="1" description="" disp_desc="0" enabled="1" from_pane="0" to_pane="0" linkto="" right_just="0" type="4" visible="1" uid="Item_0" IsAutoGenerated="0"><specific caption="Open a form in another library" /></item></action></items><ChooseFromListCollection><action type="add"><ChooseFromList UniqueID="-1" ObjectType="-1" MultiSelection="0" IsSystem="1" /></action></ChooseFromListCollection><DataBrowser BrowseBy="" /><Settings MatrixUID="" Enabled="0" EnableRowFormat="0" /></form></action></forms></Application>" /> </file> </project> </projects>