addRelationship

Hello.. I am starting to figure out how methods in aras work and to call them using postman API. I had to create a relationship between a part and a document and I made the following method. But couldnt make it work. Any idea whats wrong in this simple method? Thanks

Innovator inn = this.getInnovator();

Item partItem = inn.newItem("kth_Part", "get");
partItem.setAttribute("id", C84A89038AFF401B8067082005E83863);

Item documentItem = inn.newItem("kth_document", "get");
documentItem.setAttribute("id" , 5891B3C8039145B4BB1A8DE468DDE1E9);

partItem.addRelationship("kth_Part_Document" , documentItem);
partItem.apply();

The following is the error message but the line6 was empty
{
    "error": {
        "code": "SOAP-ENV:Server",
        "message": "Line number 6, Error Number: CS1003, Syntax error, ',' expected\r\n"
    }
}



Parents Reply
  • Hi... I tried that too but I had to face another error this time.

    {
        "error": {
            "code": "SOAP-ENV:Server",
            "message": "Line number 7, Error Number: CS1501, No overload for method 'addRelationship' takes 2 arguments\r\nLine number -3, Error Number: CS0161, 'ItemMethod.methodCode()': not all code paths return a value\r\n"
        }
    }
Children