Support Topics Documentation Slack YouTube Blog

Dates in cluase with codeless


(zeev mindali) #1

i have a block in codeless for comparing time:

but i getting always clause error.
how can i say that if the date is more then 24hours since it create, it will return true.


(zeev mindali) #3

the problem is that I want to see if the created event_items date is more then 24 in event
this is my algorithm but I don’t know how to look into events.
shell I check every date in the result that I got?


(Vladimir Upirov) #4

Hi zeev

Can you see the log message clause: {YOUR WHERE_CLAUSE} in your logs?

Thanks, Vlad


(zeev mindali) #5

nope, it will explain me where I did wrong


(Vladimir Upirov) #6

Are there any log messages on RealTime logging screen when you create a new events_items object?


(zeev mindali) #7

it’s black :frowning:


(Vladimir Upirov) #8

the page doesn’t retrieve old log messages, it just gets and keeps new messages, so the logging page must be opened, when your create a new object (through API not from Data Browser page)


(zeev mindali) #9

I getting only there

M> on Dec 10 2018 22:22:13 GMT+0200 (IST) | SERVER_CODE | INFO | [29154] Building ServerCode Model for path (/var/lib/backendless/repo/12a3f742-27db-6e63-ffd9-2dafe48de600/files/servercode/CODELESS/haifa/PRODUCTION)

Mon Dec 10 2018 22:22:13 GMT+0200 (IST) | SERVER_CODE | INFO | [29154] ServerCode Model built in 15ms

Mon Dec 10 2018 22:22:13 GMT+0200 (IST) | SERVER_CODE | INFO | [29154] [7BA70D75-426C-BA47-FFD2-AD593F54F900] [INVOKE HANDLER] persistence.beforeCreate (events_items)

Mon Dec 10 2018 22:22:14 GMT+0200 (IST) | SERVER_CODE | INFO | [29154] hgfdf

Mon Dec 10 2018 22:22:14 GMT+0200 (IST) | SERVER_CODE | INFO | [29154] Processing finished in 46.260ms


(zeev mindali) #10

don’t getting anything else


(zeev mindali) #11

I event write to log, and I don’t see anything


(Mark Piller) #12

Try to put all your logic into a try/catch block and log any errors you get (the ones in the catch block)


(zeev mindali) #13


(zeev mindali) #14

hi mark,

I made log a message, and didn’t got anything, strange
I used to get them before


(Mark Piller) #15

I suspect there is an error somewhere in the logic before it gets to the first logging block. Adding a try/catch block would help you identify the error.


(zeev mindali) #16

done as you requested
inserted it all into try catch block
still no print of the log
as the picture above


(Mark Piller) #17

is the object created in the database?


(zeev mindali) #18

events_item created in database
then it checks if it’s needed to create new item in events or make a relation to events_item


(Mark Piller) #19

do you create a new object using code or in REST Console?


(zeev mindali) #20

new object, I can not make it in rest console


(zeev mindali) #21

any idea? my all system is now not working as before
and I can’t see where is the problem