Reputation: 307
If a value is entered in a cell of grid manually, then how to check that value is present in the particular table in Microsoft dynamics AX 2009 with X++?
Upvotes: 2
Views: 1688
Reputation: 18051
Why would you want to do that using X++? No coding is needed.
Use an extended data type.
Example: To check that an employee id field is found in the table EmplTable
field EmplId
, use the EmplId
extended data type on the field in your transaction table. You will not be able to enter an employee id which is not found in employee table.
If you really want to do it in code, use the exists
method on the table.
boolean validate()
{
return EmplTable::exists(x.EmplId) || checkFailed("Employee not found");
}
Upvotes: 2