JobOrder clientCorporationID

Forum for users and developers of Bullhorn's Webservices API suite

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
enapoleone
User
Posts: 28
Joined: Sat Nov 17, 2012 12:06 am

JobOrder clientCorporationID

Post by enapoleone » Wed Jan 23, 2013 9:52 pm

I'm curious how the clientCorporationID field of the JobOrder entity works and if I should use it for queries I make on my clients behalf.

After starting a new session using startSession the parameters returned by the operation are 'session', 'corporationId' and 'userId'. In the documentation for JobOrder the description for clientCorporationID is as follows:
ID of the hiring company.

Note: When using this field in a query, you must refer to this property as clientCorporation.id (see query operation for more details).
I was wondering when I do a query for JobOrders for my client if I should be including the corporationId in the following way:

Code: Select all

$session_request = new stdClass();
$session_request->username = $username;
$session_request->password = $password;
$session_request->apiKey = $apiKey;
$API_session = $BHclient->startSession($session_request);
$API_currentSession = $API_session->return->session;

Code: Select all

$query_array = array(
        'entityName' => 'JobOrder',
        'where' => 'isDeleted=0 AND isOpen=1 AND isPublic=1 AND clientCorporation.id=' . $API_session->return->corporationId,
        'parameters' => array(),
        'distinct' => false
);
Of course I have tried this and I end up with empty results.

Can someone shed more light?

Thanks!

s.emmons
User
Posts: 333
Joined: Wed Dec 31, 1969 8:00 pm

Re: JobOrder clientCorporationID

Post by s.emmons » Mon Jan 28, 2013 3:57 pm

Hi enapoleone,

All job order records in the Bullhorn database will be tied to a client contact record, which is correspondingly tied to a client corporation record. That client corporation ID is part of the job order DTO, so this can give you another parameter by which to query for job records. However, in this case, your where clause does not specify a client corproation ID and is therefore not returning results. If you needed to build a query like this to pull jobs for a certain company, then you would need to supply the client corporation ID.
Sam Emmons
Enterprise Team Lead
BULLHORN
US Support 617-478-9126

enapoleone
User
Posts: 28
Joined: Sat Nov 17, 2012 12:06 am

Re: JobOrder clientCorporationID

Post by enapoleone » Sat Feb 02, 2013 11:13 am

Hi Sam,

Thanks for responding. Can you be specific and tell me where I would get the Client Corporation ID if not from the variable I indicate in my post?

Thanks,

John

s.emmons
User
Posts: 333
Joined: Wed Dec 31, 1969 8:00 pm

Re: JobOrder clientCorporationID

Post by s.emmons » Mon Feb 04, 2013 9:54 am

Hi John,

There's a few ways you can obtain these IDs. You may work with your client to obtain this information directly from client corporation records in the application. Otherwise you will need to build queries against the ClientCorporation to obtain IDs. This can be done in many different ways and the most efficient will likely depend on user's workflow in the application. For example, active jobs may only be tied to client corporations with a certain status. The query operation is what retrieves IDs from the database, so the important distinction with your query posted here is that you would run it against ClientCorporation instead of JobOrder.
Sam Emmons
Enterprise Team Lead
BULLHORN
US Support 617-478-9126

Post Reply