FormDataSource.name Method [AX 2012]
Gets or sets the name that is used in code to identify a form, report, table, query, or other Microsoft Dynamics AX application object.
The name property value of an object must meet the following criteria to avoid code conflicts:
-
It must start with a letter.
-
It cannot exceed 250 characters.
-
It can include numbers and underscore (_) characters.
-
It cannot include punctuation or spaces.
-
Tables cannot have the same name as other public objects, such as extended data types, base enums, or classes.
The following example creates a QueryBuildDataSource object for a form data source. The FormDataSource.name method is used to specify the name of the QueryBuildDataSource object.
static client QueryBuildDataSource fds2Qbds(FormDataSource _fds)
{
Form form = _fds.formRun().form();
if (_fds.query()
&& _fds.name()
&& _fds.query().dataSourceName(_fds.name()))
{
return _fds.query().dataSourceName(_fds.name());
}
// Use the first data source if not found by name.
if (_fds.query() && _fds.query().dataSourceNo(1))
{
return _fds.query().dataSourceNo(1);
}
return null;
}