SELECT

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
Dasani
User
Posts: 8
Joined: Thu Aug 04, 2011 11:17 pm

SELECT

Post by Dasani » Thu Aug 04, 2011 11:20 pm

i'm running the following code which grabs the Category from the database but its spitting out ID of the categories. I did a force error to see what the SQL comment is .. and its basically SELECT a.id FROM is it possible to set my own SELECT (column) FROM statement. ? It would make sense to do SELECT a.name, a.id FROM ...... so that way i don't have to send aanother query request and join the ids...

Code: Select all

		// Create an array with the query parameters
	$query_array = array(
							'entityName' => 'Category',
							'maxResults' => 20,
							'parameters' => array()
						);
		
	$SOAP_query = new SoapVar($query_array, SOAP_ENC_OBJECT,"dtoQuery", "http://query.apiservice.bullhorn.com/");
		
	
	
	$request_array = array	(
								'session' => $API_currentSession,
								'query' => $SOAP_query
							);
	
	$SOAP_request = new SoapVar($request_array, SOAP_ENC_OBJECT, "query", "http://query.apiservice.bullhorn.com/");
		
		// Use the query method to return the candidate ids
		try {
	
				$queryResult = $BHclient->query($SOAP_request);
	
			} catch (SoapFault $fault) {
	
				var_dump($BHclient->__getLastRequest());
				die($fault->faultstring);
	
			}

print_array($queryResult); 

Dasani
User
Posts: 8
Joined: Thu Aug 04, 2011 11:17 pm

Re: SELECT

Post by Dasani » Fri Aug 05, 2011 4:40 pm

Can anyone help; i would assume this is a pretty basic question. I feel like once i understand this part everything else is pretty much straight forward.

I'm confused why the Category entity is defaulting to the id property; or any of the properties in that fact? It seems weird to send another request to grab the name or other properties after i get all the IDs.

Dasani
User
Posts: 8
Joined: Thu Aug 04, 2011 11:17 pm

Re: SELECT

Post by Dasani » Fri Aug 05, 2011 4:50 pm

Is there's a PDF of the whole documentation that includes Entities, Properties etc...?????

jdonnelly
User
Posts: 192
Joined: Wed Feb 09, 2011 4:57 pm

Re: SELECT

Post by jdonnelly » Mon Aug 08, 2011 12:20 pm

Hello Dasani,

There is no facility to do a "select column from entity". You will need to retrieve the entity ids of the entities that you are interested in via the query operation, then execute a find operation to retrieve the DTOs of the entities. You can then just reference the property of the dto that you are interested in.

The documentation for Bullhorn APIs can be found at: "http://developer.bullhorn.com/documentation".

Please let me know if anything is not clear or if you have any other questions.

Thanks,
Jon Donnelly
Technical Support Engineer
Developer Forum Admin
B U L L H O R N
support@bullhorn.com

Dasani
User
Posts: 8
Joined: Thu Aug 04, 2011 11:17 pm

Re: SELECT

Post by Dasani » Mon Aug 08, 2011 3:12 pm

I understand everything perfectly clear; maybe that's a problem because i feel there's alot of methods that seem to be over complicated for the simplest task.

At the moment i'm trying to figure out how to search joborders based on category entity. At the moment i have to grab the categoryID from the jobOrders association then grab the category name from CategoryID

So in a way i have grab all the active job orders; which spits out the active categories and then i have to double back and display the joborders based on the categoryID; is that the logic here?

Here's a really important question Everytime i Send a API request (ex. query, findmultiple, etc...) is that counted as 2 request or 1? So if someone was to load the page it'll spit out 3-7 API Requests?

How many API Request are allowed a month?

Post Reply