Form Field allow edit based on conditons

some times we may get requirements to make only some fields to be to allow edit on the form grid control.
Here are the few steps, which make is easy

1. Create a Form method as below
///
/// This method is used to make fields editable based on conditions
///
///
/// 10/08/2016 by mallik
///
public void setFieldAccess()
{
   if(XXXX == YYY)
   {
       FrmDataSource_ds.object(fieldNum(FrmDataSource,LineNum)).allowEdit(false);
   
      FrmDataSource_ds.object(fieldNum(FrmDataSource,Field2)).allowEdit(false);
    }
}


2. Call the above method from the form Data source Active method after Super() as below


///
/// to check record edit
///
///
/// int
///
///
///  09/08/2016 by Mallik
///
public int active()
{
    int ret;
    ret = super();
    element. setFieldAccess();
    return ret;
}
//表编辑权限
Bom_ds.allowEdit(false);
//按钮编辑权限
NewBOMVersion.enabled(false);

表单字段允许根据条件进行编辑:http://axaptadevmallik.blogspot.com/2016/08/form-field-allow-edit-based-on-conditons.html

    Danzel
    Danzel管理员

    • 声明:本文由Danzel于2021-03-24转载(优化),转载须经原站同意并注明出处。
    • 本文地址:http://maryd.cn/?id=161
    上一篇:2021-03-03 17:10 左晓怿
    下一篇:linux防火墙查看状态及一些基本操作

    留言评论

    暂无留言
    取消
    扫码支持