Skip to main content
1-Visitor
January 15, 2018
Solved

bad PropertyDefinition datashape

  • January 15, 2018
  • 3 replies
  • 2294 views

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

Best answer by PaiChung

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

PaiChung22-Sapphire IAnswer
22-Sapphire I
January 15, 2018

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

1-Visitor
January 16, 2018

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

Thank you very much,

Marcel.

1-Visitor
January 16, 2018

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

    }

}