RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomDataSetAdapter.LocateAndApply Method

Positions the dataset and updates the resulting record based on the parameters of the current request.

Pascal
function LocateAndApply(AActionRequest: IActionRequest): Boolean;
C++
__fastcall Boolean LocateAndApply(IActionRequest AActionRequest);

LocateAndApply performs the following tasks: 

1.Extracts the current request parameters from the current request, using them to set the Mode and LocateParamsList properties. 

2.Positions the dataset (and any dataset linked to it in a master/detail relationship) on the record that the request parameters indicate. 

3.If the request put the adapter in edit or insert mode, update fields to reflect the values in the request and post the current record. 

4.If the adapter is in insert mode, change the mode to edit now that the new record has been inserted into the dataset. 

AActionRequest is an interface to the current request object. 

LocateAndApply returns true if it successfully positions the dataset and applies any specified edits. LocateAndApply returns false if it was unable to perform these tasks. If LocateAndApply returns false, it adds a message to the Errors property describing the problem. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!