CP2 to CP3 Migration: Querying Incident Table
I am working to convert a SQL query from CP2 to CP3. I referred to the below document to perform the conversion. I tried to look up the data dictionary Incident table but the conversion did not work.
$si = sql_get_int(sprintf('SELECT Count(*) from incidents where (c_id= %d) and (status_type=1 or status_type=3) and (status_id=3)',$contactId));
$res = RNCPHP\ROQL::query("SELECT count(*) AS VALUE FROM Incident WHERE Incident.PrimaryContact.ID='$contactId' AND (Incident.StatusWithType.StatusType = 1 OR Incident.StatusWithType.StatusType = 3) AND (Incident.StatusWithType.Status = 3)")->next();