cancel
Showing results for 
Search instead for 
Did you mean: 

SAP B1 UI Edit Read Only

former_member369006
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

maik_delly
Active Contributor

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

former_member369006
Participant
0 Kudos

Maik, thank you very much.

Regards,

Pawel

Answers (0)