I took the "layer" section from the JSON from the feature server for LayerB and added it to the JSON from the feature server for LayerA on the addToDefinition page. Then incorporated the sample from above into the relationships sections. Is this correct?
I feel I have the JSON formatting correct but I received an error when trying to apply it. Invalid definition for System.Collections.Generic.List`1[ESRI.ArcGIS.SDS.Metadata.LayerCoreInfo]
Exception has been thrown by the target of an invocation.
{
"adminServiceInfo" : {
"name" : "SampleData_Catch_Basins",
"type" : "FeatureServer",
"cacheMaxAge" : 0,
"status" : "Started",
"database" : {
"datasource" : {
"name" : "db"
}
}
},
"currentVersion" : 10.61,
"serviceItemId" : "...",
"serviceDescription" : "",
"hasVersionedData" : false,
"supportsDisconnectedEditing" : false,
"hasStaticData" : false,
"maxRecordCount" : 2000,
"supportedQueryFormats" : "JSON",
"supportsVCSProjection" : false,
"capabilities" : "Create,Delete,Query,Update,Editing,Sync,ChangeTracking",
"description" : "",
"copyrightText" : "",
"spatialReference" : {
"wkid" : 102100,
"latestWkid" : 3857
},
"initialExtent" : {
"xmin" : -8652196.102416249,
"ymin" : 5104375.070647859,
"xmax" : -8648522.5592200719,
"ymax" : 5105715.3676761677,
"spatialReference" : {
"wkid" : 102100,
"latestWkid" : 3857
}
},
"fullExtent" : {
"xmin" : -8652196.102416249,
"ymin" : 5104375.070647859,
"xmax" : -8648522.5592200719,
"ymax" : 5105715.3676761677,
"spatialReference" : {
"wkid" : 102100,
"latestWkid" : 3857
}
},
"allowGeometryUpdates" : true,
"units" : "esriMeters",
"supportsAppend" : true,
"size" : 16384,
"syncEnabled" : true,
"syncCapabilities" : {
"supportsAsync" : true,
"supportsRegisteringExistingData" : true,
"supportsSyncDirectionControl" : true,
"supportsPerLayerSync" : true,
"supportsPerReplicaSync" : true,
"supportsSyncModelNone" : true,
"supportsRollbackOnFailure" : true,
"supportsAttachmentsSyncDirection" : true
},
"extractChangesCapabilities" : {
"supportsReturnIdsOnly" : false,
"supportsReturnExtentOnly" : true,
"supportsReturnAttachments" : true,
"supportsLayerQueries" : true,
"supportsGeometry" : true,
"supportsFeatureReturn" : true
},
"supportsApplyEditsWithGlobalIds" : true,
"editorTrackingInfo" : {
"enableEditorTracking" : true,
"enableOwnershipAccessControl" : false,
"allowOthersToQuery" : true,
"allowOthersToUpdate" : true,
"allowOthersToDelete" : true,
"allowAnonymousToQuery" : true,
"allowAnonymousToUpdate" : true,
"allowAnonymousToDelete" : true
},
"changeTrackingInfo" :
{
"lastSyncDate" : 1536634415665,
"layerServerGens" : [
{
"id" : 0,
"minServerGen" : 8005,
"serverGen" : 8005
}
]
},
"xssPreventionInfo" : {
"xssPreventionEnabled" : true,
"xssPreventionRule" : "InputOnly",
"xssInputRule" : "rejectInvalid"
},
"layers" : [
{
"adminLayerInfo" : {
"tableName" : "...",
"geometryField" : {"name" : "Shape"},
"xssTrustedFields" : ""
},
"id" : 0,
"name" : "Point layer",
"type" : "Feature Layer",
"displayField" : "",
"description" : "",
"copyrightText" : "",
"defaultVisibility" : true,
"editFieldsInfo" : {
"creationDateField" : "CreationDate",
"creatorField" : "Creator",
"editDateField" : "EditDate",
"editorField" : "Editor"
},
"editingInfo" : {
"lastEditDate" : 1537206552230
},
"relationships" : [
{
"id" : 1,
"name" : "myRel",
"relatedTableId" : 1,
"cardinality" : "esriRelCardinalityOneToMany",
"role" : "esriRelRoleOrigin",
"keyField" : "GlobalID",
"composite" : false
}
],
"isDataVersioned" : false,
"supportsAppend" : true,
"supportsCalculate" : true,
"supportsASyncCalculate" : true,
"supportsTruncate" : false,
"supportsAttachmentsByUploadId" : true,
"supportsAttachmentsResizing" : true,
"supportsRollbackOnFailureParameter" : true,
"supportsStatistics" : true,
"supportsExceedsLimitStatistics" : true,
"supportsAdvancedQueries" : true,
"supportsValidateSql" : true,
"supportsCoordinatesQuantization" : true,
"supportsQuantizationEditMode" : true,
"supportsApplyEditsWithGlobalIds" : true,
"advancedQueryCapabilities" : {
"supportsPagination" : true,
"supportsPaginationOnAggregatedQueries" : true,
"supportsQueryRelatedPagination" : true,
"supportsQueryWithDistance" : true,
"supportsReturningQueryExtent" : true,
"supportsStatistics" : true,
"supportsOrderBy" : true,
"supportsDistinct" : true,
"supportsQueryWithResultType" : true,
"supportsSqlExpression" : true,
"supportsAdvancedQueryRelated" : true,
"supportsCountDistinct" : true,
"supportsQueryAttachments" : true,
"supportsReturningGeometryCentroid" : false,
"supportsQueryWithDatumTransformation" : true,
"supportsHavingClause" : true,
"supportsOutFieldSQLExpression" : true,
"supportsMaxRecordCountFactor" : true,
"supportsTopFeaturesQuery" : true
},
"useStandardizedQueries" : true,
"geometryType" : "esriGeometryPoint",
"minScale" : 0,
"maxScale" : 0,
"extent" : {
"xmin" : -8652196.102416249,
"ymin" : 5104375.070647859,
"xmax" : -8648522.5592200719,
"ymax" : 5105715.3676761677,
"spatialReference" : {
"wkid" : 102100,
"latestWkid" : 3857
}
},
"drawingInfo":{"renderer":{"type":"simple","symbol":{"angle":0,"xoffset":0,"yoffset":0,"type":"esriPMS","url":"287c0bfa-518b-4ace-a8bf-c58ea264fdea","imageData":"iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xTuc4+QAAB3VJREFUeF7tmPlTlEcexnve94U5mANQbgQSbgiHXHINlxpRIBpRI6wHorLERUmIisKCQWM8cqigESVQS1Kx1piNi4mW2YpbcZONrilE140RCTcy3DDAcL/zbJP8CYPDL+9Ufau7uqb7eZ7P+/a8PS8hwkcgIBAQCAgEBAICAYGAQEAgIBAQCAgEBAICAYGAQEAgIBAQCDx/AoowKXFMUhD3lQrioZaQRVRS+fxl51eBTZUTdZ41U1Rox13/0JF9csGJ05Qv4jSz/YPWohtvLmSKN5iTGGqTm1+rc6weICOBRbZs1UVnrv87T1PUeovxyNsUP9P6n5cpHtCxu24cbrmw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x8Iu1TRcfnrioICAQEAgIBgYBAQCAgEBAICAQEAgIBgYBAQCAgEBAICAQEAv8H44b/6ZiGvGAAAAAASUVORK5CYII=","contentType":"image/png","width":15,"height":15}},"transparency":0},
"allowGeometryUpdates" : true,
"hasAttachments" : true,
"attachmentProperties" : [
{
"name" : "name",
"isEnabled" : true
},
{
"name" : "size",
"isEnabled" : true
},
{
"name" : "contentType",
"isEnabled" : true
},
{
"name" : "keywords",
"isEnabled" : true
}
],
"htmlPopupType" : "esriServerHTMLPopupTypeNone",
"hasM" : false,
"hasZ" : false,
"objectIdField" : "FID",
"globalIdField" : "GlobalID",
"typeIdField" : "",
"fields" : [
{
"name" : "FID",
"type" : "esriFieldTypeOID",
"actualType" : "int",
"alias" : "FID",
"sqlType" : "sqlTypeInteger",
"nullable" : false,
"editable" : false,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "GlobalID",
"type" : "esriFieldTypeGlobalID",
"alias" : "",
"sqlType" : "sqlTypeOther",
"length" : 38,
"nullable" : false,
"editable" : false,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "CreationDate",
"type" : "esriFieldTypeDate",
"alias" : "CreationDate",
"sqlType" : "sqlTypeOther",
"length" : 8,
"nullable" : true,
"editable" : false,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "Creator",
"type" : "esriFieldTypeString",
"alias" : "Creator",
"sqlType" : "sqlTypeOther",
"length" : 128,
"nullable" : true,
"editable" : false,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "EditDate",
"type" : "esriFieldTypeDate",
"alias" : "EditDate",
"sqlType" : "sqlTypeOther",
"length" : 8,
"nullable" : true,
"editable" : false,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "Editor",
"type" : "esriFieldTypeString",
"alias" : "Editor",
"sqlType" : "sqlTypeOther",
"length" : 128,
"nullable" : true,
"editable" : false,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "InspectionDate",
"type" : "esriFieldTypeDate",
"alias" : "Inspection Date",
"sqlType" : "sqlTypeOther",
"length" : 0,
"nullable" : true,
"editable" : true,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "AmtRemoved",
"type" : "esriFieldTypeDouble",
"alias" : "Pounds of Debris Removed",
"sqlType" : "sqlTypeOther",
"nullable" : true,
"editable" : true,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "NeedsRepair",
"type" : "esriFieldTypeString",
"alias" : "Needs Repair?",
"sqlType" : "sqlTypeOther",
"length" : 3,
"nullable" : true,
"editable" : true,
"visible" : true,
"domain" : null,
"defaultValue" : "No"
},
{
"name" : "RepairType",
"type" : "esriFieldTypeString",
"alias" : "Type of Repairs",
"sqlType" : "sqlTypeOther",
"length" : 256,
"nullable" : true,
"editable" : true,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "Notes",
"type" : "esriFieldTypeString",
"alias" : "",
"sqlType" : "sqlTypeOther",
"length" : 256,
"nullable" : true,
"editable" : true,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "YearInspected",
"type" : "esriFieldTypeInteger",
"alias" : "Year Inspected",
"sqlType" : "sqlTypeOther",
"nullable" : true,
"editable" : true,
"visible" : true,
"domain" : null,
"defaultValue" : 2018
}
],
"indexes" : [
{
"name" : "GlobalID_Index",
"fields" : "GlobalID",
"isAscending" : false,
"isUnique" : true,
"description" : ""
},
{
"name" : "...",
"fields" : "Shape",
"isAscending" : false,
"isUnique" : false,
"description" : "Shape Index"
},
{
"name" : "PK__SampleDa__C1BEA5A2744565A2",
"fields" : "FID",
"isAscending" : true,
"isUnique" : true,
"description" : "clustered, unique, primary key"
},
{
"name" : "CreationDateIndex",
"fields" : "CreationDate",
"isAscending" : true,
"isUnique" : false,
"description" : "CreationDate Field index"
},
{
"name" : "CreatorIndex",
"fields" : "Creator",
"isAscending" : false,
"isUnique" : false,
"description" : "Creator Field index"
},
{
"name" : "EditDateIndex",
"fields" : "EditDate",
"isAscending" : true,
"isUnique" : false,
"description" : "EditDate Field index"
},
{
"name" : "EditorIndex",
"fields" : "Editor",
"isAscending" : false,
"isUnique" : false,
"description" : "Editor Field index"
}
],
"types" : [],
"templates" : [
{
"name" : "New Feature",
"description" : "",
"drawingTool" : "esriFeatureEditToolNone",
"prototype" : {
"attributes" : {
"InspectionDate" : null,
"AmtRemoved" : null,
"NeedsRepair" : "No",
"RepairType" : null,
"Notes" : null,
"YearInspected" : 2018
}
}
}
],
"supportedQueryFormats" : "JSON, geoJSON",
"hasStaticData" : false,
"maxRecordCount" : 2000,
"standardMaxRecordCount" : 32000,
"tileMaxRecordCount" : 8000,
"maxRecordCountFactor" : 1,
"capabilities" : "Create,Delete,Query,Update,Editing,Sync,ChangeTracking",
"exceedsLimitFactor" : 1
},
{
"adminLayerInfo" : {
"tableName" : "...", "geometryField" : null,
"xssTrustedFields" : ""
},
"id" : 1,
"name" : "CatchBasinInspections",
"type" : "Table",
"displayField" : "",
"description" : "",
"copyrightText" : "",
"defaultVisibility" : true,
"editingInfo" : {
"lastEditDate" : null
},
"relationships" : [
{
"id" : 1,
"name" : "myRel",
"relatedTableId" : 0,
"cardinality" : "esriRelCardinalityOneToMany",
"role" : "esriRelRoleDestination",
"keyField" : "reference",
"composite" : false
}
],
"isDataVersioned" : false,
"supportsAppend" : true,
"supportsCalculate" : true,
"supportsASyncCalculate" : true,
"supportsTruncate" : false,
"supportsAttachmentsByUploadId" : true,
"supportsAttachmentsResizing" : true,
"supportsRollbackOnFailureParameter" : true,
"supportsStatistics" : true,
"supportsExceedsLimitStatistics" : true,
"supportsAdvancedQueries" : true,
"supportsValidateSql" : true,
"supportsCoordinatesQuantization" : true,
"supportsQuantizationEditMode" : true,
"supportsApplyEditsWithGlobalIds" : false,
"advancedQueryCapabilities" : {
"supportsPagination" : true,
"supportsPaginationOnAggregatedQueries" : true,
"supportsQueryRelatedPagination" : true,
"supportsQueryWithDistance" : true,
"supportsReturningQueryExtent" : true,
"supportsStatistics" : true,
"supportsOrderBy" : true,
"supportsDistinct" : true,
"supportsQueryWithResultType" : true,
"supportsSqlExpression" : true,
"supportsAdvancedQueryRelated" : true,
"supportsCountDistinct" : true,
"supportsReturningGeometryCentroid" : false,
"supportsQueryWithDatumTransformation" : true,
"supportsHavingClause" : true,
"supportsOutFieldSQLExpression" : true,
"supportsMaxRecordCountFactor" : true,
"supportsTopFeaturesQuery" : true
},
"useStandardizedQueries" : true,
"allowGeometryUpdates" : true,
"hasAttachments" : false,
"htmlPopupType" : "esriServerHTMLPopupTypeNone",
"hasM" : false,
"hasZ" : false,
"objectIdField" : "ObjectId",
"globalIdField" : "",
"typeIdField" : "",
"fields" : [
{
"name" : "reference",
"type" : "esriFieldTypeInteger",
"actualType" : "int",
"alias" : "reference",
"sqlType" : "sqlTypeInteger",
"nullable" : true,
"editable" : true,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "Insp_date",
"type" : "esriFieldTypeDate",
"actualType" : "datetime2",
"alias" : "Insp_date",
"sqlType" : "sqlTypeTimestamp2",
"length" : 8,
"nullable" : true,
"editable" : true,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "notes",
"type" : "esriFieldTypeString",
"actualType" : "nvarchar",
"alias" : "notes",
"sqlType" : "sqlTypeNVarchar",
"length" : 256,
"nullable" : true,
"editable" : true,
"visible" : true,
"domain" : null,
"defaultValue" : null
},
{
"name" : "ObjectId",
"type" : "esriFieldTypeOID",
"actualType" : "int",
"alias" : "ObjectId",
"sqlType" : "sqlTypeInteger",
"nullable" : false,
"editable" : false,
"visible" : true,
"domain" : null,
"defaultValue" : null
}
],
"indexes" : [
{
"name" : "PK__CATCHBAS__9A61929115D6101B",
"fields" : "ObjectId",
"isAscending" : true,
"isUnique" : true,
"description" : "clustered, unique, primary key"
}
],
"types" : [],
"templates" : [],
"supportedQueryFormats" : "JSON, geoJSON",
"hasStaticData" : true,
"maxRecordCount" : 2000,
"standardMaxRecordCount" : 32000,
"tileMaxRecordCount" : 8000,
"maxRecordCountFactor" : 1,
"capabilities" : "Query",
"exceedsLimitFactor" : 1
}
]
}