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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

how to create a thing and set Property in another thing service whit javascript

lfen
1-Visitor

how to create a thing and set Property in another thing service whit javascript

i have created a thing with javascript in the snipert service CreateThing ,but then i want to set the thing just created Propertis ,the thing create success,but the properties created failed.there is nothing error shown in Application ,this my script

ACCEPTED SOLUTION

Accepted Solutions

You need a restart after the EnableThing and before setting the property:

Things[thingName].RestartThing();

Also you need to create the Thing with the prepared parameters ( before (EnableThing) ):

Resources["EntityServices"].CreateThing(params);

View solution in original post

3 REPLIES 3
lfen
1-Visitor
(To:lfen)

can not set Properties success too

You need a restart after the EnableThing and before setting the property:

Things[thingName].RestartThing();

Also you need to create the Thing with the prepared parameters ( before (EnableThing) ):

Resources["EntityServices"].CreateThing(params);

lfen
1-Visitor
(To:CarlesColl)

thank you so much ,your answer solve my problem perfectly!

Announcements


Top Tags