You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

CP2 to CP3 Migration: Querying Incident Table

Received Response
13
Views
16
Comments
edited Feb 7, 2018 8:06PM in Customer Portal 16 comments

Content

Hi,

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.

http://documentation.custhelp.com/euf/assets/docs/november2013/cp_resources/migration/migration_guide.pdf

CP2:

$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));

CP3: 

$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(); 

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!