Skip to main content
1-Visitor
February 7, 2017
Question

Creating Links with Navigate services

  • February 7, 2017
  • 1 reply
  • 2370 views

Hi. I'm developing a custom application on navigate and i need to create a link between two objects using the "Link" service, so I created my custom service called "CrearEnlace" to test it but It doesn't work, when I invoke the service the next error occurs

123123.png

Do you guys know how can  I execute this service in the right way? Thank You from your time.

1 reply

5-Regular Member
February 7, 2017

Are you able to share the contents of your service?

1-Visitor
February 7, 2017

    This is my custom service code, Here I fetch an object which represent the child and after I get the result I try to create the Link with another object which is the parent.

     var params = {

        infoTableName : "InfoTable",

        dataShapeName : "SingleValueShape"

        };

        // CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(values)

        var r = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);

        r.AddRow({

        value:'VR:wt.part.WTPart:170623'}

            );

        params = {

        ufids: r /* INFOTABLE */,

        dataShape: "ptc-part-demo-shape" /* DATASHAPENAME */

        };

        // result: INFOTABLE dataShape: "undefined"

          //Here I get the child object which im going to add

        var resultFetch = me.Fetch(params);

        params = {

        infoTableName : "InfoTable",

        dataShapeName : "ptc-part-demo-shape"

        };

        // CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(ptc-part-demo-shape)

        var inf = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);

        params = {

        associations: resultFetch /* INFOTABLE */,

        parentUfid: "VR:wt.part.WTPart:198464" /* STRING */, //THIS IS THE OBJECT I'll USE AS THE PARENT.

        dataShape: "pdl.wt.part.WTPartDescribeLink" /* DATASHAPENAME */

        };

        // result: INFOTABLE dataShape: "undefined"

        var result = me.Link(params);

5-Regular Member
February 7, 2017

What does your Fetch service return? I do not think that comes OOTB in ThingWorx...