FormDataSource.name Method

Gets or sets the name that is used in code to identify a form, report, table, query, or other Microsoft Dynamics AX application object.

Syntax

public str name([str value])

Run On

Client

Parameters

  • value
    Type: str
    The name for the data source; optional.

Return Value

Type: str
The name that is used in code to identify an application object.

Remarks

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.

Examples

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; 
}

See Also

FormDataSource Class

FormDataSource.executeQuery Method

FormDataSource.init Method