Post

2 followers Follow
0
Avatar

CZQL reference Project

Could anyone please help me to get the project SYSID of the Project I'm in.  I have created a custom Panel and I can't figure out how to call the CurrentObject. 

In the code below, I need the "P-801" to dynamically update when I go from one project to another.

I'm using CZQL inside a script

 

var projectsQuery = "Select Name, C_WorksiteAddress, C_GPSLocation, Description, TrackStatus, PlannedRevenue, DueDate, Duration from Task " +
"where C_WorksiteAddress<>'' AND State='Active' and Project IN (SELECT ID FROM project WHERE SYSID='" + "P-801" + "') limit 1000 ";

API.Objects.query(projectsQuery, function(markers)

 

 

Juan Holtzhausen Answered

Official comment

Avatar

Hi Juan,

Your query looks good.

I tried it in my environment and it works as expected:

SELECT Name FROM Task WHERE Project IN (SELECT ID FROM Project WHERE SYSID="P-101")

Please check your query.

Pay attention to the following. Do you really mean empty string in C_WorksiteAddress<>'' ? I guess you actually wanted C_WorksiteAddress<>null. Empty string is not same as null.

Try to use simpler query similar to the my query for the testing. Is it works?

Alex Broitman
Comment actions Permalink

Please sign in to leave a comment.

1 comment