FormDataSource Class
The FormDataSource class contains properties that define the behavior of data sources in forms.
Syntax
class FormDataSource extends FormObjectSet
Run On
Client
Methods
Method | Description | |
---|---|---|
active | Retrieves data from joined data sources when a user navigates to a new record and then sets the new record as the current record. (Overrides the active Method.) | |
addFieldToSelectionList | ||
addNotifyHandler | (Inherited from FormObjectSet.) | |
addReferenceFieldToSelectionList | ||
allowCheck | ||
allowCreate | ||
allowDeferredLoad | ||
allowDelete | ||
allowEdit | Determines whether the user can change the contents of the control. | |
allRowsLoaded | ||
anyMarked | Checks whether any records in the underlying cache are marked. | |
autoNotify | ||
autoQuery | ||
autoSearch | ||
cacheAddMethod | Registers the specified display or edit method for caching. | |
cacheCalculateMethod | Calls the specified cached method and updates the value in the cache for the current record. | |
cacheOnlyMode | ||
cacheRemoveRecord | Removes the specified record from the underlying cache of the data source. | |
cancelTimeOut | Cancels a previous method call to the setTimeOut method. (Inherited from Object.) | |
canCreate | ||
canDelete | ||
canEdit | ||
clearDisplayOption | Clears display options that were previously specified for a record and then redraws the record. | |
clearReferenceData | ||
company | ||
counterField | ||
create | Creates a new record in the data source. (Overrides the create Method.) | |
createTypes | ||
crossCompanyAutoQuery | ||
cursor | Has no functionality in the FormObjectSet class. (Overrides the cursor Method.) | |
cursorNotify | Notifies the application about a cursor event. | |
defaultMark | Sets the default mark value for records in a form, which determines whether records are marked when they have been selected in a grid. | |
delayActive | ||
delete | Deletes the current record from the data source. (Overrides the delete Method.) | |
deleted | ||
deleteMarked | Deletes all marked (selected) records from a data source. (Overrides the deleteMarked Method.) | |
deleting | ||
displayOption | Sets the text color and the background color for a record in the data source. | |
equal | Determines whether the specified object is equal to the current one. (Inherited from Object.) | |
executeQuery | Executes the data source query and displays the records that are retrieved. | |
extends | ||
filter | Filters records in the data source. | |
findRecord | Finds the specified record in the data source and makes it the current record. (Overrides the findRecord Method.) | |
findValue | Finds the specified value in the data source and makes the record that has that value the current record that uses the FormDataSource.findRecord method. | |
first | Moves focus to the first record in the data source. (Overrides the first Method.) | |
forceWrite | ||
formRun | (Inherited from FormObjectSet.) | |
functionObject | ||
getDataRow | ||
getFirst | Retrieves the first record in a data set. | |
getNext | Returns the next record that meets the criteria that are set up in an earlier call to the FormDataSource.getFirst method. | |
getPosition | (Inherited from FormObjectSet.) | |
getTimeOutTimerHandle | Returns the timer handle for the object. (Inherited from Object.) | |
handle | Retrieves the handle of the class of the object. (Inherited from Object.) | |
id | Retrieves the ID of the data source. (Overrides the id Method.) | |
index | ||
init | Creates a data source query that is based on the data source properties. (Overrides the init Method.) | |
initValue | Initializes field values in a new record. (Overrides the initValue Method.) | |
insertAtEnd | ||
insertIfEmpty | ||
isBaseDataSource | ||
isInheritanceDataSource | ||
isOptionalRecordCreated | ||
isReferenceDataSource | ||
joinRelation | ||
joinRelationAsDictRelation | ||
joinSource | ||
joinSourceDataSource | ||
last | Moves the mouse pointer to the last record in the data source. (Overrides the last Method.) | |
leave | Provides notification when the mouse pointer is moved to the next record or to another data source. | |
leaveRecord | Provides notification when the focus moves to another record or item in the form. (Overrides the leaveRecord Method.) | |
linkActive | Calls the FormDataSource.exeuteQuery method on data sources that are linked to the current data source. | |
linkType | ||
mark | ||
markAllLoadedRecords | ||
markChanged | ||
markRecord | Marks the specified record by using the specified mark value. | |
markRecords | ||
masterInheritanceDataSource | ||
masterObjectSet | Retrieves the master object set for the current object set. (Inherited from FormObjectSet.) | |
maxAccessRight | ||
maxPagingRowCountValue | ||
name | Gets or sets the name that is used in code to identify a form, report, table, query, or other Microsoft Dynamics AX application object. (Overrides the name Method.) | |
new | Initializes a new instance of the Object class. (Inherited from Object.) | |
next | Moves the focus to the next record in the data source. (Overrides the next Method.) | |
nextPage | Moves a specified number of records forward in the data source. (Overrides the nextPage Method.) | |
notify | Releases the hold on an object that has called the wait method on this object. (Inherited from Object.) | |
notifyAll | Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.) | |
numberOfRowsLoaded | ||
object | Returns an instance of the FormDataObject class that has the specified ID. (Overrides the object Method.) | |
objectOnServer | Determines whether the object is on a server. (Inherited from Object.) | |
onlyFetchActive | ||
optionalRecordMode | ||
owner | Returns the instance that owns the object. (Inherited from Object.) | |
pageSize | ||
pagingEnabled | ||
parentTitleFields | ||
prev | Moves the focus to the previous record in the data source. (Overrides the prev Method.) | |
prevPage | Moves the focus back by a specified number of records in the data source. (Overrides the prevPage Method.) | |
Prints the current record. | ||
prompt | Activates the standard form, SysQueryForm, that is used to limit a query range. (Overrides the prompt Method.) | |
query | ||
queryBuildDataSource | ||
queryRun | ||
queryRunQueryBuildDataSource | ||
recordsMarked | ||
refresh | Updates the form by updating the view of all the records in the data source. (Overrides the refresh Method.) | |
refreshEx | Updates the view of the specified records. (Overrides the refreshEx Method.) | |
removeFieldFromSelectionList | ||
removeFilter | Resets the query for the data source. (Overrides the removeFilter Method.) | |
removeNotifyHandler | (Inherited from FormObjectSet.) | |
reread | Rereads the current record from the database. (Overrides the reread Method.) | |
rereadReferenceDataSources | ||
research | Is overridden by the FormDataSource.research method. (Overrides the research Method.) | |
selectionChanged | ||
setCurrent | ||
setPagingParameters | ||
setPosition | (Inherited from FormObjectSet.) | |
setRecord | ||
setTimeOut | Sets up the scheduled execution of a specified method. (Inherited from Object.) | |
startPosition | ||
startRowIndex | ||
table | Gets or sets the table ID associated with the object. | |
titleFields | ||
toString | Returns a string that represents the current object. (Inherited from Object.) | |
totalNumberOfRows | ||
usageCount | Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.) | |
validateDelete | Requests that the user confirm the deletion of a record from the data source. (Overrides the validateDelete Method.) | |
validateWrite | Determines whether data is valid and ready to be written. (Overrides the validateWrite Method.) | |
validTimeStateAutoQuery | ||
validTimeStateUpdate | ||
wait | Pauses a process. (Inherited from Object.) | |
write | Calls the FormDataSource.validateWrite method and manages the database write operation. (Overrides the write Method.) | |
writing | ||
written | ||
xml | Returns an XML string that represents the current object. (Inherited from Object.) |
Top
Remarks
By overriding the methods on the class, you can customize the behavior for the method actions, such as insertion or validation, for a specific form. The FormDataSource class is also used to determine how the data source table is related to other data sources (tables) that are displayed in the form.
To override some of the methods in the FormDataSource class, right-click the Methods node for a form data source, and then click Override Method.
When you create methods on a form, you should use a _ds identifier to reference the FormDataSource object for a particular class. For example, CustTrans_ds references the FormDataSource object for the CustTrans data source on the form, and CustTrans_ds.executeQuery() executes the FormDataSource.executeQuery method on the CustTrans data source.
Several FormDataSource methods return a FormObjectSet object. To use the methods that are defined on the FormDataSource method on this object, you must typecast it to a FormDataSource object.
Examples
The following example supplies a custom query for a field instead of the automatically generated query. It overrides the performFormLookup method on the field.
public void performFormLookup(FormRun _p1, FormControl _formControl)
{
FormDataSource formDataSource;
QueryRun queryRunGenerated;
// The FormDataSource object retrieved from the FormRun parameter.
formDataSource = _p1.dataSource(1);
// Get the generated query.
queryRunGenerated = formDataSource.queryRun();
// Modify the query.
// ...
// Call the standard implementation of performFormLookup
// with the parameters supplied in this method.
super(_p1, _formControl);
}
Inheritance Hierarchy
Object Class
FormObjectSet Class
FormDataSource Class