on 05-28-2015 1:07 PM
Hi All,
I haven't found anything on search to a related Field....
I add a Field
oItem = oForm.Items.Add("LCardCode", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oItem.Left = 10 + StatWidth;
oItem.Width = StatWidth;
oItem.Top = 40;
oItem.Height = StatHight;
oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
oEdit.DataBind.SetBound(true, "@MyUserTable", "U_SCardCode");
then add a linked Button
oItem = oForm.Items.Add("CardCode", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON);
oLinkBtn = (SAPbouiCOM.LinkedButton)oForm.Items.Item("CardCode").Specific;
oLinkBtn.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_BusinessPartner;
oItem.Left = StatWidth - 10;
oItem.Top = 40;
oItem.LinkTo = "LCardCode";
Like the CardCode Filed in BusinessPartner...
Any Ideas?
Best Regards
Oliver
Ok I Found the solution in ChoosfromList.
Know I don't know the correct way of setting the Value back to my Form.
oItem = oForm.Items.Add("LCardCode", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oItem.Left = 10 + StatWidth;
oItem.Width = StatWidth;
oItem.Top = 40;
oItem.Height = StatHight;
oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
oEdit.DataBind.SetBound(true, "@MyUserTable", "U_SCardCode");
oEdit.ChooseFromListUID = "List";
oEdit.ChooseFromListAlias = "CardCode";
I Add an EventHandler
and I try to set the EditItem
SAPbouiCOM.EditText EditText = null;
EditText = (SAPbouiCOM.EditText)oForm.Items.Item("LCardCode").Specific;
EditText.Value = val;
but I get an Exeption, no Focus for this Object...
and writing to DB at this time is not the best Idea...
What its the best way of doing this?
Regards
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Oliver,
The correct way would be to write the value on the datasource and not on the item.
Get the DBDatasource from the form and write to the appropriate column:
DbDatasource myDatasource = oForm.Datasources.DBDatasource.Item("@MyUserTable");
myDatasource.SetValue("U_SCardCode", 0, val);
Note that this only works on user defined forms/datasources.
Best regards,
Pedro Magueija
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.