on 07-26-2012 10:44 AM
Hi,
On the item master form, there is a tab named 'Properties' that contains the properties which can be used for sorting and grouping items in reports.
Now, i would like to have these values (check boxes) displayed on my addon form.
I have managed to display these properties as checkboxes on my addon form, however, the check boxes are all unchecked even when they are actually checked for that particular item on the Item Master form.
Where can i read these values from?
Kind regards,
Esau
Hi,
maybe you did not use a datasource for your checkbox. when you load the form use the following code for each of your checkbox - than you should be able to select/check the box.
oForm.DataSources.UserDataSources.Add("ckBox1", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1);
((SAPbouiCOM.CheckBox)(oForm.Items.Item("ckBox1").Specific)).DataBind.SetBound(true, "", "ckBox1");
EDIT:
in case you want to know how you get the Data from the Item Object via DIAPI:
oItems.get_Properties(int GroupNum)
lg David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you David for your suggestion.
I have attached some screenshots of my form and related tables - I may be missing something.
The attached documents:ItemProperties_ScreenShots.txt and ItemProperties_ScreenShots.jpg
Basically, i have the properties displaying on my form - its getting the checked values for the select properties that i was not able to achieve.
Any ideas are appreciated.
Esau.
Hi,
ok - you are using a matrix - the easist way is to fill the matrix with a datatable.
but than you should create the datasource in another way.
here's a sample for DataTable DataSource:
oForm.DataSources.UserDataSources.Add("dsCheck", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1);
((SAPbouiCOM.Matrix)(oForm.Items.Item("mtxUID").Specific)).Columns.Item("ColCheck").DataBind.SetBound(true, "", "dsCheck");
oForm.DataSources.DataTables.Add("LIST");
oForm.DataSources.DataTables.Item("LIST").ExecuteQuery("SELECT Field FROM Table");
((SAPbouiCOM.Matrix)(oForm.Items.Item("mtxUID").Specific)).Columns.Item("ColCheck").DataBind.Bind("LIST", "Field");
((SAPbouiCOM.Matrix)(oForm.Items.Item("mtxList").Specific)).Clear();
((SAPbouiCOM.Matrix)(oForm.Items.Item("mtxList").Specific)).LoadFromDataSource();
this will fill your matrix column with the field from the query - and it should work for your checkbox column.
give it a try
lg David
Thank you very much guys for your assistance.
Edy, your hint saved me a bit of a headache - i was so focussed on finding an "ItemsProperties" field
David, the solution i ended up with basically matches your code sample 😉
Again, thanks!
Esau.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.