Solved

query events with system custom fields (items)

  • 19 December 2022
  • 2 replies
  • 150 views

Userlevel 1
Badge

HI all,

I need to write a query that will extract some events with system custom fields (items).

 

I found some exemples here on the wiki, but not regarding item system custom fileds

https://wiki.axiossystems.com/assyst11-5Wiki/index.php/Installation:Database_Schema_for_Additional_Custom_Fields#Retrieving_values_of_custom_fields

 

Can anyone help me?

 

thanks!

icon

Best answer by MennovH 5 January 2023, 17:34

View original

2 replies

Userlevel 4
Badge +12

@KevinM - This one might be in your wheelhouse.

Userlevel 3
Badge +10

The following can be used to get the selected items from custom fields that are lookups to the item table. Just replace PLACE_HOLDER with the shortcode of the custom field you want to extract.

 

(SELECT i.item_n FROM item i, 
    jptsys_web_cust_prop_cont c, 
    jptsys_web_cust_prop jwcp
 WHERE i.item_id = c.lookup_val_id  
 AND jwcp.jptsys_web_cust_prop_id = c.jptsys_web_cust_prop_id  
 AND jwcp.jptsys_web_cust_prop_sc = 'PLACE_HOLDER' 
 AND c.entity_id = incident.incident_id)

 

Regards,

 

Menno

Reply