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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Turn a property into a ReadOnly after I change the value

fmanniti
10-Marble

Turn a property into a ReadOnly after I change the value

When I create the thing which inherits the properties from the template I would like that some of them will be readonly.

The problem is, if I check ReadOnly checkbox from template, I'm not able to assign to the Thing a value after I've created it, sois it possible to switch a property for a single Thing into a readOnly after I've assigned a value? And, if so, what is the snippet?

ACCEPTED SOLUTION

Accepted Solutions

No it isn't, as you can't set custom Thing Logged properties for the ones that comes from Templates or Shapes.

If you want to have this kind of personalization ( "same" property name but Things level custom Metadata ( ReadOnly, Logged, ... ) ) you will have to create the Properties on the Thing itself.

You can do something like on ThingStart subscription from the template check if the property exists, and if it doesn't exist create it.

View solution in original post

2 REPLIES 2

No it isn't, as you can't set custom Thing Logged properties for the ones that comes from Templates or Shapes.

If you want to have this kind of personalization ( "same" property name but Things level custom Metadata ( ReadOnly, Logged, ... ) ) you will have to create the Properties on the Thing itself.

You can do something like on ThingStart subscription from the template check if the property exists, and if it doesn't exist create it.

Thank you

Announcements


Top Tags