ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / ParcelFabricExtensions Class / GetRecordsLayerAsync Method
The parcel layer.
Example

In This Topic
    GetRecordsLayerAsync Method
    In This Topic
    Gets the records layer for the given parcel layer.
    Syntax
    public static Task<List<FeatureLayer>> GetRecordsLayerAsync( 
       ParcelLayer parcelLayer
    )
    Public Shared Function GetRecordsLayerAsync( _
       ByVal parcelLayer As ParcelLayer _
    ) As Task(Of List(Of FeatureLayer))

    Parameters

    parcelLayer
    The parcel layer.

    Return Value

    A Task to a set of record layers.
    Exceptions
    ExceptionDescription
    Insufficient license. This method requires a standard license.
    Example
    Create a new record
    string errorMessage = await QueuedTask.Run(async () =>
    {
      Dictionary<string, object> RecordAttributes = new Dictionary<string, object>();
      string sNewRecord = "MyRecordName";
      try
      {
        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.";
        var recordsLayer = await myParcelFabricLayer.GetRecordsLayerAsync();
        var editOper = new EditOperation()
        {
          Name = "Create Parcel Fabric Record",
          ProgressMessage = "Create Parcel Fabric Record...",
          ShowModalMessageAfterFailure = true,
          SelectNewFeatures = false,
          SelectModifiedFeatures = false
        };
        RecordAttributes.Add("Name", sNewRecord);
        var editRowToken = editOper.Create(recordsLayer.FirstOrDefault(), RecordAttributes);
        if (!editOper.Execute())
          return editOper.ErrorMessage;
    
        var defOID = -1;
        var lOid = editRowToken.ObjectID.HasValue ? editRowToken.ObjectID.Value : defOID;
        await myParcelFabricLayer.SetActiveRecordAsync(lOid);
      }
      catch (Exception ex)
      {
        return ex.Message;
      }
      return "";
    });
    if (!string.IsNullOrEmpty(errorMessage))
      MessageBox.Show(errorMessage, "Create New Record.");
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also