如果填写了另一个字段,是否可以禁用一个字段中的输入? [英] Is it possible to disable input in one field if another is filled?

查看:68
本文介绍了如果填写了另一个字段,是否可以禁用一个字段中的输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果另一个字段包含MS Dynamics AX 2012中的数据,我想禁用对表字段的输入.

I want to disable input into fields of a table, if another field contains data in MS Dynamics AX 2012.

更新1:

如果输入了Field1,则Field2和Field3必须为空

If Field1 has input, Field2 and Field3 MUST be EMPTY

| Field1 | Field2 | Field3 |客户编号|ID |

|Field1|Field2|Field3| Customer nr | Id|

| --- 1 --- | -------- | -------- |0000000001 |01

|---1---|--------|--------| 0000000001| 01

更新2:

系统是否可以触发错误/警告消息,就像在ID中输入重复值时一样-> AllowDuplicates:No

Can the system fire an error/warning message, like it does when entering a duplicate value in an ID --> AllowDuplicates: No

-

无法在表(表)中创建记录.表格ID:01.记录已经存在.

Cannot create a record in Table (Table). Table Id: 01. The record already exists.

推荐答案

是的,在表上创建一个方法.

Yes, make a method on the table.

在这种情况下(在 ProjTable 上),禁止在子项目中编辑名称:

In this case (on ProjTable) the editing of the name on sub projects is prohibited:

void setFieldProperty()
{
    FormObjectSet fds = this.dataSource();
    if (fds)
    {                
        fds.object(fieldNum(ProjTable,Name)).allowEdit(!this.ParentId);
    }
}

然后从数据源 active 形式和数据源依赖的数据源字段 modified 方法(在本例中为 ParentId ).

Then call the method from the form datasource active method and from datasource fields modified methods on which the critieria depends (in this case ParentId).

响应UPDATE 2:

Response to UPDATE 2:

看看 aosValidateInsert aosValidateUpdate

这篇关于如果填写了另一个字段,是否可以禁用一个字段中的输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆