Highlighted
Member.. udo_mic
Member..
227 views

Linking one record to two others using the Service API

Jump to solution

I'm using HP Content Manager 9.1 and want to link one record to two other records using the Service API 1.0. Using the regular client I can link one record to multiple other records:

two_links.PNG

I'm able to create a link to one other record using:

{
  "RecordTitle":"t2",
  "RecordRecordType": 7,
  "RecordAlternativeContainer": "7505",
  "Uri" : "7508"
}

However, it will only create one relation. If I make a second call using a second id e.g. 7506 it will replace the first relation and be only related to 7506.

Retrieving a record created with two links I get a response like:

"RecordAlternativeContainer": {
  "TrimType": "Record",
  "RecordNumber": {   "Value": "NTI19/000885" },
  "RecordTitle": { "Value": "1904" },
  "Uri": 7505,
  "Icon": {
    "IsFileTypeIcon": false, "IsInternalIcon": true,
    "IsValid": true,  "FileType": "",  "Id": "RedBook"
   },
   "NameString": "NTI19/000885"
},
"RecordAlternativeContainers": {
  "Value": "NTI19/000885: 1904\r\nNTI19/000886: 1905"
},

It outputs another property "RecordAlternativeContainers". I tried passing it as returned and just using the Uris, but I had no luck with that. The behavior for "RecordRelatedRecord" seems to be the same.

How can I link one record with two others?

Labels (1)
0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Re: Linking one record to two others using the Service API

Jump to solution

Use the ChildRelationships collection.


Blog | Samples | HPE CM 9.3 SDK Docs
**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of MicroFocus**
2 Replies
Micro Focus Expert
Micro Focus Expert

Re: Linking one record to two others using the Service API

Jump to solution

Use the ChildRelationships collection.


Blog | Samples | HPE CM 9.3 SDK Docs
**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of MicroFocus**
Member.. udo_mic
Member..

Re: Linking one record to two others using the Service API

Jump to solution
Thanks. Seems to work well.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.