Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hi Team,
I was using TWX 8.3 version earlier which was having below snippet:-
var params = {
thingName: thingName /* STRING */
};
// result: BOOLEAN
var result = Resources["PTC.Factory.CommonUtilities"].DoesThingExists(params);
But in ThingWorx 9.1, PTC.Factory.CommonUtilities is not available.
How would I run my code now?
Please provide snippet for ThingWorx 9.1 for checking the existence of Thing in the composer.
Thanks in advance.
Solved! Go to Solution.
Hi @ranjank.
PTC.Factory.CommonUtilities sounds like ThingWorx Apps. Do you have Manufacturing or Service Apps installed?
As an alternative, you could do something like this:
try{
result = Things[thingName].name;
}
catch (err) {
result = "Thing does not exist";
}
You'll need to pass in the thingName you're looking for.
Regards.
--Sharon
Hi @ranjank.
PTC.Factory.CommonUtilities sounds like ThingWorx Apps. Do you have Manufacturing or Service Apps installed?
As an alternative, you could do something like this:
try{
result = Things[thingName].name;
}
catch (err) {
result = "Thing does not exist";
}
You'll need to pass in the thingName you're looking for.
Regards.
--Sharon
Hi @ranjank.
If the previous response answered your question, please mark it as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon