Skip to main content
17-Peridot
November 22, 2019
Solved

FindDataTableEntries doesn't work if the data shape's boolean field set to true?

  • November 22, 2019
  • 2 replies
  • 1613 views

Hi ,

 

I have a data table with the data shape below,  just found a very strange behavior, for the service: 

--------------------------------------------------------------

var values = me.CreateValuesWithData({
values: { WorkOrderId: "NA", DeviceId: "OP10-OvenREHM00001" } /* JSON */
});

result = me.FindDataTableEntries({
values: values /* INFOTABLE */
});

-------------------------------------------------------

The result always return empty as long as the field Estimated is true , otherwise it work well.   Is it a known issue ? 

 

Thingworx version: 8.4.4

Database: Posgresql 10.x

 

-----------Table Structure-----------------

 

Seq
INTEGER
KEY  
 
DeviceId
STRING
KEY  
 
DataProducedTime
DATETIME
KEY  
 
WorkOrderId
STRING
KEY  
 
StartTime
DATETIME
   
 
Estimated
BOOLEAN
 
Best answer by smainente

Hi,

This behavior is working as per product specifications.

You can find more information in : https://www.ptc.com/en/support/article?n=CS292316

2 replies

12-Amethyst
November 22, 2019

Hi seanccc,

 

FindDataTablesEntries() is listed as only searching on set indexes which might be why you are seeing some issues. Other alternatives include QueryDataTableEntries() or if you have the key for the record you are searching for GetDataTableEntryByKey() is better if you are looking for one record. 

 

Note: If using GetDataTableEntryByKey(), it is a best practice to wrap the call in a try/catch block as GetDataTableEntryByKey() will throw an error if it does not find the record.

 

-Andrew

smainente16-PearlAnswer
16-Pearl
November 22, 2019

Hi,

This behavior is working as per product specifications.

You can find more information in : https://www.ptc.com/en/support/article?n=CS292316

seanccc17-PeridotAuthor
17-Peridot
November 23, 2019

@smainente ,

 

Thank for the information.  The find* service work again if  remove the default value setting.  

 

Regards,

Sean