cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Creating Links with Navigate services

egolindano
7-Bedrock

Creating Links with Navigate services

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.

4 REPLIES 4
ttielebein
14-Alexandrite
(To:egolindano)

Are you able to share the contents of your service?

    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);

ttielebein
14-Alexandrite
(To:egolindano)

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

Returns an infotable with information about the object.

zcaszxc.png

Announcements


Top Tags