Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAP B1 UI Edit Read Only

Hello.

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.

My code:

SAPbouiCOM.Item oNewItemEdit;

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.

Regards,

Pawel

replied

Hi Pawel,

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 )

regards,

Maik

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question