CM 23X Service API Alternative container not allowing to map multiple container for single record

Hi ,

I am facing issue to map one single document with multiple Alternative container.

I tried to pass uri's for 2 containers  (please refer below screenshot), but I am getting the Error.

but while try to single URI it works fine but here the issue it will override the existing mapping. its not allowing multiple mapping.

Need to suggestion here , how to map multiple alternative container for single record.

  • Suggested Answer

    0  

    Hi Rinku,

    The ChildRelationships property is the one to use (an Array of RecordRelationship)

    RecordRelationship looks to require a RecordRelationshipRelationshipType and a RecordRelationshipRelatedRecord

    Sample Before:

    Sample Payload:

    {
      "Uri": 4,
      "RecordRecordType": "File Folder",
      "ChildRelationships": [{
          "RecordRelationshipRelationType": "IsAltIn",
          "RecordRelationshipRelatedRecord": {
    				"FindBy":"uri:5"
    			}
        }, {
    			"RecordRelationshipRelationType": "IsAltIn",
          "RecordRelationshipRelatedRecord": {
    				"FindBy":"uri:6"
    			}
    		}
      ]
    }
    

    After:

    Response Payload:

    {
    	"Results": [
    		{
    			"ChildRelationships": [
    				{
    					"RecordRelationshipCanView": {
    						"Value": true
    					},
    					"RecordRelationshipDescription": {
    						"Value": "Alternatively within"
    					},
    					"RecordRelationshipIsReverse": {
    						"Value": false
    					},
    					"RecordRelationshipRelatedRecord": {
    						"RecordExtension": {
    							"Value": ""
    						},
    						"RecordNumber": {
    							"Value": "75/189"
    						},
    						"RecordTitle": {
    							"Value": "Great Barrier Reef Marine Park Authority (GBRMPA) Act - Initial Appointments to the Authority"
    						},
    						"TrimType": "Record",
    						"Uri": 5,
    						"Icon": {
    							"IsFileTypeIcon": false,
    							"IsInternalIcon": true,
    							"IsExternalIcon": false,
    							"IsValid": true,
    							"FileType": "",
    							"Id": "YellowFile",
    							"Hash": 0
    						},
    						"NameString": "75/189"
    					},
    					"RecordRelationshipRelatedTitle": {
    						"Value": "Great Barrier Reef Marine Park Authority (GBRMPA) Act - Initial Appointments to the Authority"
    					},
    					"RecordRelationshipRelationNumber": {
    						"Value": 1
    					},
    					"RecordRelationshipRelationType": {
    						"Value": "IsAltIn",
    						"StringValue": "Alternatively within"
    					},
    					"RecordRelationshipReverseRelationType": {
    						"Value": "RisAltIn",
    						"StringValue": "Alternatively contains"
    					},
    					"Delete": false,
    					"IgnoreOnUpdate": false,
    					"TrimType": "RecordRelationship",
    					"NameString": "75/189",
    					"ToolTip": "75/189",
    					"Uri": 559
    				},
    				{
    					"RecordRelationshipCanView": {
    						"Value": true
    					},
    					"RecordRelationshipDescription": {
    						"Value": "Alternatively within"
    					},
    					"RecordRelationshipIsReverse": {
    						"Value": false
    					},
    					"RecordRelationshipRelatedRecord": {
    						"RecordExtension": {
    							"Value": ""
    						},
    						"RecordNumber": {
    							"Value": "75/478"
    						},
    						"RecordTitle": {
    							"Value": "Great Barrier Reef Marine Park Authority Act (GBRMPA) - Clarification and Dissemination of the Role, Goals and Aims of the Authority"
    						},
    						"TrimType": "Record",
    						"Uri": 6,
    						"Icon": {
    							"IsFileTypeIcon": false,
    							"IsInternalIcon": true,
    							"IsExternalIcon": false,
    							"IsValid": true,
    							"FileType": "",
    							"Id": "YellowFile",
    							"Hash": 0
    						},
    						"NameString": "75/478"
    					},
    					"RecordRelationshipRelatedTitle": {
    						"Value": "Great Barrier Reef Marine Park Authority Act (GBRMPA) - Clarification and Dissemination of the Role, Goals and Aims of the Authority"
    					},
    					"RecordRelationshipRelationNumber": {
    						"Value": 1
    					},
    					"RecordRelationshipRelationType": {
    						"Value": "IsAltIn",
    						"StringValue": "Alternatively within"
    					},
    					"RecordRelationshipReverseRelationType": {
    						"Value": "RisAltIn",
    						"StringValue": "Alternatively contains"
    					},
    					"Delete": false,
    					"IgnoreOnUpdate": false,
    					"TrimType": "RecordRelationship",
    					"NameString": "75/478",
    					"ToolTip": "75/478",
    					"Uri": 560
    				}
    			],
    			"RecordRecordType": {
    				"RecordTypeName": {
    					"Value": "File Folder"
    				},
    				"RecordTypeUsualBehaviour": {
    					"Value": "Folder",
    					"StringValue": "Folder"
    				},
    				"TrimType": "RecordType",
    				"Uri": 3,
    				"Icon": {
    					"IsFileTypeIcon": false,
    					"IsInternalIcon": true,
    					"IsExternalIcon": false,
    					"IsValid": true,
    					"FileType": "",
    					"Id": "YellowFile",
    					"Hash": 0
    				}
    			},
    			"TrimType": "Record",
    			"Uri": 4
    		}
    	],
    	"PropertiesAndFields": {},
    	"TotalResults": 1,
    	"MinimumCount": 0,
    	"Count": 0,
    	"HasMoreItems": false,
    	"TrimType": "Record",
    	"ResponseStatus": {}
    }

    URI 4 is now 'Alt Contained' in both URI 5 and URI 6

    -Scotty

  • 0   in reply to   

    Hi Scotty, 

    Thank you for providing details information, that really helps us resolve the issue.

    We have one more query,  as you mentioned on update need to pass the Uri for the alternative container which needs to be map with the document. but we have requirement where get the uri dynamically for the alternative container we need to create one more get request for that . is there any other option we can pass the string value like title or some additional filed, that will help us to avoid to create one more get request.

    the mapping works only with uri?

    Please let me know your input on this regards.

    Thanks & Regards

    Rinku Saha

  • 0   in reply to   

    Hi Rinku,

    The 'FindBy' clause in the Request body is able to contain ANY search string that you can craft in the CM Client, so you can use it for Title, or Additional Field, however, from memory, if the FindBy clause would find more that one record 'E.g. as title may not be unique' it will only use the 'first' result to come back in the query and would error if 0 results come back.

    {
      "Uri": 4,
      "RecordRecordType": "File Folder",
      "ChildRelationships": [{
          "RecordRelationshipRelationType": "IsAltIn",
          "RecordRelationshipRelatedRecord": {
            "FindBy": "title:\"DUGONG GREAT BARRIER REEF\""
          }
        }, {
          "RecordRelationshipRelationType": "IsAltIn",
          "RecordRelationshipRelatedRecord": {
            "FindBy": "AdditionalField:ABC123"
          }
        }
      ]
    }
    

    This has had very mixed results in the past for myself, so my recommendation is make the extra request to retrieve the URI as you can then also code in the scenario what happens when 0 results come back (you need to create the container) or 2+ results come back (put it to an exception queue for manual intervention then replay)

    -Scotty

  • 0   in reply to   

    Hi Scotty,

    Thank you for your suggestion. it really helps to achieve the requirement.