Skip to main content
1-Visitor
Oct 29, 2024 5:41 AM UTC
Solved

DB entity service return null when calling from another entity

GY_10982725_0-1730180106013.png

I have a service on a database entity, executing a simple select max() operation, when running in the entity, it works and returns a result (number) as shown in the screenshot. but when I call this service from another db entity as below: 

   

    lastTickTimeStamp = Things["Egress_KCT_FTAE"].Get_Last_TicksTimeStamp_Test();

 

it always return null as lastTickTimeStamp;

However, the other serivce (query to return an infotable) on the Things["Egress_KCT_FTAE"] can work in the same location without problem.

14-Alexandrite
Oct 29, 2024 9:52 AM UTC

The SQL service returns an infotable, so  to get the value you might need to do lastTickTimeStamp .rows[0].lastTickTimeStamp. Use alias in the SQL like MAX(lastTickTimeStamp ) AS lastTickTimeStamp 

2 replies

14-Alexandrite
Oct 29, 2024 9:52 AM UTC

The SQL service returns an infotable, so  to get the value you might need to do lastTickTimeStamp .rows[0].lastTickTimeStamp. Use alias in the SQL like MAX(lastTickTimeStamp ) AS lastTickTimeStamp 

Translate
Community Moderator
Nov 4, 2024 6:40 AM UTC

Hello @GY_10982725,

 

It looks like you have a response from a community member. If it helped to answer your question please mark the reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.

Translate