<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Thing is not enabled even though EnableThing/RestartThing is called in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Thing-is-not-enabled-even-though-EnableThing-RestartThing-is/m-p/691369#M48274</link>
    <description>&lt;P&gt;I am trying to create a DataTable from a service.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;try {
    var thingParams = {
        name: "MyDataTable",
        description: undefined /* STRING */,
        thingTemplateName: "DataTable" /* THINGTEMPLATENAME */,
        tags: undefined /* TAGS */
    };
    // no return
    Resources["EntityServices"].CreateThing(thingParams);
    
    Things["MyDataTable"].EnableThing();
    Things["MyDataTable"].RestartThing();
    
    Things["MyDataTable"].SetProjectName({ projectName: "MyProject" });
    Things["MyDataTable"].SetDataShape({ name: "MyDataShape" });
} catch (err) {
    logger.error(me.name + " Service DataTableHelper.WriteToDataTable has an error on line #" + err.lineNumber + ": " + err.message);
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get the foolowing error:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DemoFileHelper Service DataTableHelper.WriteToDataTable has an error on line #14: com.thingworx.common.exceptions.InvalidRequestException: Thing [MyDataTable] is not enabled&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Line 14 is the one where I set the Project Name.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any help would be welcomed.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Oct 2020 02:47:45 GMT</pubDate>
    <dc:creator>cmelancon</dc:creator>
    <dc:date>2020-10-07T02:47:45Z</dc:date>
    <item>
      <title>Thing is not enabled even though EnableThing/RestartThing is called</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Thing-is-not-enabled-even-though-EnableThing-RestartThing-is/m-p/691369#M48274</link>
      <description>&lt;P&gt;I am trying to create a DataTable from a service.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;try {
    var thingParams = {
        name: "MyDataTable",
        description: undefined /* STRING */,
        thingTemplateName: "DataTable" /* THINGTEMPLATENAME */,
        tags: undefined /* TAGS */
    };
    // no return
    Resources["EntityServices"].CreateThing(thingParams);
    
    Things["MyDataTable"].EnableThing();
    Things["MyDataTable"].RestartThing();
    
    Things["MyDataTable"].SetProjectName({ projectName: "MyProject" });
    Things["MyDataTable"].SetDataShape({ name: "MyDataShape" });
} catch (err) {
    logger.error(me.name + " Service DataTableHelper.WriteToDataTable has an error on line #" + err.lineNumber + ": " + err.message);
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get the foolowing error:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;DemoFileHelper Service DataTableHelper.WriteToDataTable has an error on line #14: com.thingworx.common.exceptions.InvalidRequestException: Thing [MyDataTable] is not enabled&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Line 14 is the one where I set the Project Name.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Any help would be welcomed.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 02:47:45 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Thing-is-not-enabled-even-though-EnableThing-RestartThing-is/m-p/691369#M48274</guid>
      <dc:creator>cmelancon</dc:creator>
      <dc:date>2020-10-07T02:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Thing is not enabled even though EnableThing/RestartThing is called</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Thing-is-not-enabled-even-though-EnableThing-RestartThing-is/m-p/691458#M48295</link>
      <description>&lt;P&gt;I have moved the setDataShape declaration a bit higher and it seemed to work. (changed the datashape and project name with something on my system).&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;try {
    var thingParams = {
        name: "MyDataTable",
        description: undefined /* STRING */,
        thingTemplateName: "DataTable" /* THINGTEMPLATENAME */,
        tags: undefined /* TAGS */
    };
    // no return
    Resources["EntityServices"].CreateThing(thingParams);
    
    Things["MyDataTable"].EnableThing();
    Things["MyDataTable"].SetDataShape({
	name: "ad" /* DATASHAPENAME */
});
    Things["MyDataTable"].RestartThing();
    
    Things["MyDataTable"].SetProjectName({ projectName: "GitBackup" });
   
} catch (err) {
    logger.error(me.name + " Service DataTableHelper.WriteToDataTable has an error on line #" + err.lineNumber + ": " + err.message);
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 13:14:19 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Thing-is-not-enabled-even-though-EnableThing-RestartThing-is/m-p/691458#M48295</guid>
      <dc:creator>VladimirRosu</dc:creator>
      <dc:date>2020-10-07T13:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Thing is not enabled even though EnableThing/RestartThing is called</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Thing-is-not-enabled-even-though-EnableThing-RestartThing-is/m-p/691489#M48302</link>
      <description>&lt;P&gt;Thank you, it worked!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 14:52:37 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Thing-is-not-enabled-even-though-EnableThing-RestartThing-is/m-p/691489#M48302</guid>
      <dc:creator>cmelancon</dc:creator>
      <dc:date>2020-10-07T14:52:37Z</dc:date>
    </item>
  </channel>
</rss>

