Sunday, September 27, 2020

Enable or Disable the Unbonded Fields on Form in ax 2012 using X++

 

Hi guys ,Today we see how to enable Unbonded fields on form in ax 2012 using X++.

Here i write code in active method. Just check below example.


if(Table.Name== "Test")

{

    Table_ds.object(fieldNum(Table, Field)).enabled(true);

}  

------------Or-----------

Table_ds.object(fieldNum(Table, Field)).enabled(Table.Name== "Test");


Examples:

public int active()

{

int ret;

ret = super();

Table_ds.object(fieldNum(Table, Field)).enabled(Table.Name== "Test");

return ret;

}

Below example for Vendor Bank account number and name.


public int active()

{

    int ret;

    ret = super();

    VendBankAccount_ds.object(fieldNum(VendBankAccount, AccountNum)).enabled(VendBankAccount.WorkflowStatus==WorkflowStatus::Approved || VendBankAccount.WorkflowStatus==WorkflowStatus::NotSubmitted);

    VendBankAccount_ds.object(fieldNum(VendBankAccount, Name)).enabled(VendBankAccount.WorkflowStatus==WorkflowStatus::Approved || VendBankAccount.WorkflowStatus==WorkflowStatus::NotSubmitted);

    return ret;

}

Keep Daxing!!


No comments:

Post a Comment