QPR Knowledge Base 2012.1



Previous topic Next topic  


Previous topic Next topic  

Revision history:

Introduced in QPR 8.1


Add references to objects (defined in targetObjectIds) into referenceAttribute of objects defined by objectIds. Reference attributes define relations between objects and e.g. Portal actions have parents and external parents as reference attributes.




void AddReference(string sessionId, string objectIds, string referenceAttribute, string targetObjectIds, string options)


Return Value:






sessionId: String. ID of an authenticated session.

objectIds: String. A comma-separated list of FullID's of objects to be modified (i.e. which gain references to target objects).

referenceAttribute: String. Name of the reference attribute.

targetObjectIds: String. A comma-separated list of FullID's of object to which references should be created.

options: String. A comma-separated list of options.


Example Procedure:


ServiceClient client = new ServiceClient("WSHttpBinding_IService");

string sessionId = client.Authenticate("qpr", "demo");
string[][] attributes = { new string[] { "Description", "Hello from QPR Web Services Foundation" }, new string[] { "Category", "Initiative" } };

string objectId = client.CreateObject(sessionId, "PO", "actionplan", "Action Plan created via WS API", "", attributes, "");

string[][] attributesForCopy = { new string[] { "Description", "Copied object" }, new string[] { "Category", "Initiative"} };

string copiedObjectId = client.CreateCopy(sessionId, objectId, "", attributesForCopy, "");

// set the first object as the parent for the copied object

client.AddReference(sessionId, copiedObjectId, "parentobjects", objectId, "");