ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ParcelFabricExtensions Class / SetActiveRecordAsync Method / SetActiveRecordAsync(ParcelLayer,String) Method
The parcel layer.
The name of the parcel record feature to be set as the current record.
Example

In This Topic
    SetActiveRecordAsync(ParcelLayer,String) Method
    In This Topic
    Sets the active record.
    Syntax
    public static Task<bool> SetActiveRecordAsync( 
       ParcelLayer parcelLayer,
       string name
    )
    Public Overloads Shared Function SetActiveRecordAsync( _
       ByVal parcelLayer As ParcelLayer, _
       ByVal name As String _
    ) As Task(Of Boolean)

    Parameters

    parcelLayer
    The parcel layer.
    name
    The name of the parcel record feature to be set as the current record.

    Return Value

    A Task to a bool indicating if the active record is set.
    Exceptions
    ExceptionDescription
    Insufficient license. This method requires a standard license.
    Remarks
    All clients, including the parcel heads-up-display on the active map, will be notified and use the values given. Values for the parcel record must be set correctly to match the underlying data.
    Example
    Set the active record
    string errorMessage = await QueuedTask.Run(async () =>
    {
      try
      {
        string sExistingRecord = "MyRecordName";
        var myParcelFabricLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<ParcelLayer>().FirstOrDefault();
        //if there is no fabric in the map then bail
        if (myParcelFabricLayer == null)
          return "There is no fabric in the map.";
    
        bool bSuccess = await myParcelFabricLayer.SetActiveRecordAsync(sExistingRecord);
        if (!bSuccess)
          return "No record called " + sExistingRecord + " was found.";
      }
      catch (Exception ex)
      {
        return ex.Message;
      }
      return "";
    });
    if (!string.IsNullOrEmpty(errorMessage))
      MessageBox.Show(errorMessage, "Set Active Record.");
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also