CA Service Management

  • 1.  Lookup A User with a Filter applied

    Posted Dec 14, 2016 04:37 PM

    I have a request form that I need to do a lookup of contacts with a specific filter applied. It needs to return only the supervisors within the current cost code. I can do this with a sql statement like so:

     

    select distinct ca_contact.contact_uuid , last_name, first_name, aud_ca_resource_cost_center.name from 
    (select distinct ca_contact.supervisor_contact_uuid from ca_contact) as t1
    inner join ca_contact on ca_contact.contact_uuid = t1.supervisor_contact_uuid
    inner join aud_ca_resource_cost_center on ca_contact.cost_center = aud_ca_resource_cost_center.id
    where aud_ca_resource_cost_center.name = '2950'

     

    I know that the dropdown gives me the ability to do a filter here:

     

     

    I just can't seem to connect the dots to make the lookup actually work on the front end. 

    Any help would be appreciated!



  • 2.  Re: Lookup A User with a Filter applied

    Posted Dec 19, 2016 02:35 AM

    When you're trying to come up with the proper where-clauses you'll be better off working on the object level, bop_odump is great for that. It saves you the hassle of doing the joins manually when the end result will be on the object level anyway.

    So to develop the where-clause with bop_odump you'd do something like this:

    bop_odump domsrvr cnt "billing_code.name = '2950'" id last_name first_name billing_code.name

    And when you're happy with the results you just grab the where-clause from the double quotes and slap it on the dtlDropdown ...whereclause="<here>">. The attributes/columns you return on the bop_odump don't matter, it's just for you to verify you get the results you expect to get.