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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Best Practices for Coding in Javascript

Willie
16-Pearl

Best Practices for Coding in Javascript

I found the following link for best practices for coding in javascript:

https://support.ptc.com/help/thingworx/platform/r9/en/index.html#page/ThingWorx/Help/Best_Practices_for_Developing_Applications/JavaScriptCodingBestPractices.html

 

Is this specific to thingworx 9?

 

For example, it states infotables can be created in 1 line.

var table = DataShapes["GenericStringList"].CreateValues();

 

I am on thingworx 8.5.3, and do not see any services under datashapes as it is not "thing". 

4 REPLIES 4
Willie
16-Pearl
(To:Willie)

I know many of the best practices apply regardless of the thingworx version, but I'm wondering if all of them apply to any thingworx version or only to thingworx 9.

Willie
16-Pearl
(To:Willie)

I was able to create an infotable with

var table = DataShapes["GenericStringList"].CreateValues();

in thingworx 8.5.3, so I'm assuming the best practices apply to all versions of thingworx.

slangley
23-Emerald II
(To:Willie)

Hi @Willie.

 

I'm glad you were able to find a solution to your question.  There are other ways to create infotables.  The page from the Help Center you referenced is just providing a quicker way of creating a datatable from a static data shape. 

 

In terms of whether the best practices for ThingWorx 9 apply to previous releases of the product is not easily answerable.  Each release contains numerous changes and methods may change over time.  It's always best to refer to the documentation for your given release but that does not mean that new information being presented with new releases would not apply. 

 

Regards.

 

--Sharon

 

 

slangley
23-Emerald II
(To:slangley)

Hi @Willie.

 

It would be helpful if you could mark the appropriate response (even if it's yours) as the Accepted Solution for the benefit of others with the same question. 

 

If you have remaining questions, please let us know.

 

Regards.

 

--Sharon

Top Tags