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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

AddPropertyDefinition: Invalid pushType

mhoskins
6-Contributor

AddPropertyDefinition: Invalid pushType

I am attempting to programmatically add a property to a remote thing. I need to set the push type to "Always pushed", but passing a value of "Always pushed" as a parameter yields the following error:

 

Error executing service <Service>. Message :: Invalid Push Type : [Always pushed] - See Script Error Log for more details.

 

I've experimented with every variation of "Always pushed" I can think of with no luck. What is the proper string input needed to specify the push type?

 

 

The code for the service is below: 

 

try{
Things["myThing"].property = 0;

}catch(err){
var error=err.message;
if(error.match(/not found on myThing/)!=null){
var params = {
defaultValue: undefined /* STRING */,
remoteBindingAspects: undefined /* JSON */,
description: undefined /* STRING */,
readOnly: false /* BOOLEAN */,
type: "STRING" /* BASETYPENAME */,
remote: true /* BOOLEAN */,
remotePropertyName: 'remotepropertyname' /* STRING */,
timeout: undefined /* INTEGER */,
pushType: 'Always pushed' /* STRING */,
dataChangeThreshold: undefined /* NUMBER */,
logged: undefined /* BOOLEAN */,
name: "property" /* STRING */,
pushThreshold: undefined /* NUMBER */,
dataChangeType: undefined /* STRING */,
category: undefined /* STRING */,
persistent: true /* BOOLEAN */,
dataShape: undefined /* DATASHAPENAME */
};

// no return
Things["myThing"].AddPropertyDefinition(params);

// no return
Things["myThing"].RestartThing();

}
}

1 ACCEPTED SOLUTION

Accepted Solutions

Instead of pushType, Try 


"dataChangeType": "ALWAYS"

 

 

 

View solution in original post

1 REPLY 1

Instead of pushType, Try 


"dataChangeType": "ALWAYS"

 

 

 

Top Tags