SAP B1 UI Edit Read Only
I would like to add Edit Item to system form that is bound to user-defined-field and is read-only.
Also I need LinkButton that is linked to newly created Edit Item.
oNewItemEdit = frm.Items.Add(cMyEdit, BoFormItemTypes.it_EDIT);
SAPbouiCOM.Item oNewItemLnk = frm.Items.Add(cMyLBt, BoFormItemTypes.it_LINKED_BUTTON);
SAPbouiCOM.EditText oMyEdit = ((SAPbouiCOM.EditText)(oNewItemEdit.Specific));
((SAPbouiCOM.LinkedButton)(oNewItemLnk.Specific)).Item.LinkTo = cMyEdit;
oMyEdit.DataBind.SetBound(true, "OPCH", "U_MyField");
oMyEdit.Item.Enabled = false;
I suppose that property Enabled is the right one, but it seems SAP B1 always set newly added Edit Item as editable.
Maik Delly replied
just append this line to your code:
oMyEdit.Item.SetAutoManagedAttribute(SAPbouiCOM.BoAutoManagedAttr.ama_Editable, 15, SAPbouiCOM.BoModeVisualBehavior.mvb_False);
The problem you are experiencing results from the auto from mode managment of SBO ( different mode -> standard value : editable )