Skip to main content
Jan 15, 2018 4:03 PM UTC
Solved

bad PropertyDefinition datashape

Hello,

Somehow I did manage to delete most fields from my PropertyDefinition datashape. I need to put the fields back on.

Would someone tell me which are the fields of this datashape so I can restore it?

Thank you in advance,

Marcel

PaiChungAnswer
Jan 15, 2018 6:00 PM UTC

This is a system object that you aren't supposed to be able to edit ...

baseType - basetypename

description - string

isLogged - boolean

isPersistent - boolean

isReadOnly - boolean

name - string

3 replies

PaiChungAnswer
Jan 15, 2018 6:00 PM UTC

This is a system object that you aren't supposed to be able to edit ...

baseType - basetypename

description - string

isLogged - boolean

isPersistent - boolean

isReadOnly - boolean

name - string

Jan 16, 2018 9:37 AM UTC

Yes, I don't know exaclty how it happened... If I ever discover I'll be posting it here.

Thank you very much,

Marcel.

Jan 16, 2018 10:15 AM UTC

I just found out how it happened: by altering the shape of that infotable I also did change the PropertyDefinition datashape. i'll be sure to create a different infotable next time.

var r = Things[Device].GetPropertyDefinitions(params);

// infotable datashape iteration

var dataShapeFields = r.dataShape.fields;

for (var fieldName in dataShapeFields) {

    if(fieldName != "description") {

r.RemoveField(fieldName);

    }

}