Skip to main content
Nov 22, 2019 12:33 PM UTC
Solved

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

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
 
smainenteAnswer
Nov 22, 2019 2:50 PM UTC

Hi,

This behavior is working as per product specifications.

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

3 replies

Nov 22, 2019 2:30 PM UTC

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

smainenteAnswer
Nov 22, 2019 2:50 PM UTC

Hi,

This behavior is working as per product specifications.

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

seancccAuthor
Nov 23, 2019 2:49 AM UTC

@smainente ,

 

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

 

Regards,

Sean