Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
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
Do you guys know how can I execute this service in the right way? Thank You from your time.
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);
What does your Fetch service return? I do not think that comes OOTB in ThingWorx...
Returns an infotable with information about the object.