5 Replies Latest reply on Feb 7, 2017 11:26 AM by egolindano RSS
    egolindano Explorer

    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.

      • Re: Creating Links with Navigate services
        ttielebein Collaborator

        Are you able to share the contents of your service?

          • Re: Creating Links with Navigate services
            egolindano Explorer

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