FormDataSource.getFirst Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
getFirst() |
Retrieves the first record in a data set. |
getFirst(Int32) | |
getFirst(Int32, Boolean) |
getFirst()
Retrieves the first record in a data set.
public:
virtual Microsoft::Dynamics::Ax::Xpp::Common ^ getFirst();
public virtual Microsoft.Dynamics.Ax.Xpp.Common getFirst ();
abstract member getFirst : unit -> Microsoft.Dynamics.Ax.Xpp.Common
override this.getFirst : unit -> Microsoft.Dynamics.Ax.Xpp.Common
Public Overridable Function getFirst () As Common
Returns
The first record in the data set.
Remarks
If the mark parameter is not 0 (zero), the first record that is marked with the specified value is returned, and subsequent calls to the FormDataSource.getNext method return marked records. If the fetchAhead parameter is set to false, only cached records are returned. If it is set to true, additional records are found and added to the cache, but the operation can become very time-consuming when it is performed on a large record set. When records in a grid are multiselected, the records are marked with the value 1. The following examples illustrate how to retrieve a marked or unmarked record: // Get first recordformDataSource.getFirst();// Get first record marked with 2formDataSource.getFirst(2); // Get first cached record marked with 1formDataSource.getFirst(1, false);
The following example determines whether two records are selected in a form.
boolean twoMarked()
{
SysVersionControlTmpItem tmpitem = this.getFirst(1);
if (!tmpitem)
{
return false;
}
tmpitem = this.getNext();
if (!tmpitem)
{
return false;
}
tmpitem = this.getNext();
if (!tmpitem)
{
return true;
}
return false;
}
Applies to
getFirst(Int32)
public:
virtual Microsoft::Dynamics::Ax::Xpp::Common ^ getFirst(int num1);
public virtual Microsoft.Dynamics.Ax.Xpp.Common getFirst (int num1);
abstract member getFirst : int -> Microsoft.Dynamics.Ax.Xpp.Common
override this.getFirst : int -> Microsoft.Dynamics.Ax.Xpp.Common
Public Overridable Function getFirst (num1 As Integer) As Common
Parameters
- num1
- Int32
Returns
Applies to
getFirst(Int32, Boolean)
public:
virtual Microsoft::Dynamics::Ax::Xpp::Common ^ getFirst(int _mark, bool _fetchAhead);
public virtual Microsoft.Dynamics.Ax.Xpp.Common getFirst (int _mark, bool _fetchAhead);
abstract member getFirst : int * bool -> Microsoft.Dynamics.Ax.Xpp.Common
override this.getFirst : int * bool -> Microsoft.Dynamics.Ax.Xpp.Common
Public Overridable Function getFirst (_mark As Integer, _fetchAhead As Boolean) As Common
Parameters
- _mark
- Int32
A Boolean value; optional. The default value is true.
- _fetchAhead
- Boolean
A Boolean value; optional. The default value is true.