Column job_order removed from get_activities?

27 views
Skip to first unread message

Bryan Moore

unread,
Jan 13, 2017, 2:50:40 PM1/13/17
to CATS API

Please restore job_order number (or its equivalent) to the get_actvities results

Details:
The get_activities API worked for us for 2015 and weekly throughout most of 2016, until at least December 5, but failed sometime after that as we have had no success since December 12, 2016.
> Charlie wrote:
>     I have been using your version 2 API for well over a year now to output the various Activities for all of our active Job Orders. A few weeks back the function I use to get all the activities for a specific Job Order started to return 0 activities. Then about a week later it started to work again, but now it is once again no longer working.
>     I am using your API function:
>     get_activities($search = '', $rows_per_page = '', $page_number = '', $sort = '', $sort_direction = '', $display_column = '', $filter = ‘')

The actual line of code that worked for 18 months was:
    $activity_results = $api->get_activities($JO_ID, 50, $activity_page_offset, 'date', 'asc', $activity_display_column);

where JO_ID is the several digit job_order number

Note: this may actually return more results in the case that the job_order number appears within notes. We can live with that by further processing the returned results.

I am not certain about the format of $activity_display_column
The sample at https://api.catsone.com/api/get_activities concatenates the columns with commas
However I saw another developer using another method thus:
    &display_column[]=name&display_column[]=date&display_column[]=notes&display_column[]=....
Neither method caused job_order to appear in results

So, CATS needs to please restore the missing job_order field to the returned results
API v3 is no substitute until it also includes job_order

Aaron Baluczynski

unread,
Jan 13, 2017, 4:32:38 PM1/13/17
to CATS API
Hi Bryan,

We recently updated our searching capabilities and it looks like this bug may have been a result of that. A developer is looking into it.

Aaron

Bryan Moore

unread,
Jan 13, 2017, 4:56:53 PM1/13/17
to CATS API

Thanks for the quick reply, Aaron

For what it's worth:
If I use the longer form for display column (not display_column=name,regarding,job_order ... but instead &display_column[]=name&display_column[]=regarding&display_column[]=job_order  then this does retrieve job_order but it's text not numeric.

So I'm not sure what field name it was that was returning the numeric job_order before.
I don't have a raw capture of the previously working xml results containing the job order numbers, but they were in there until between Dec 5 and 12

Bryan

Aaron Baluczynski

unread,
Jan 13, 2017, 5:05:29 PM1/13/17
to CATS API
The way I understand it the code is searching for all activities related to a particular job order ID. The bug causes it to return 0 results instead of the correct results. Why do you need the job order ID as a column when you are searching by that value? (No columns were specified in the sample code.)

Bryan Moore

unread,
Jan 13, 2017, 7:12:34 PM1/13/17
to CATS API

Aaron wrote

> The way I understand it the code is searching for all activities related to a particular job order ID.

Yes searching activities for matching job_order numbers was our intent and used to work through Dec 5 and not after Dec 12. We are using the job_order number returned from get_joborders so we weren't checking the result back from get_activities so it was only my assumption that job_order number was in results.

If not, we can live with the skew that may result when the job order number is found in some other field (notes, for example) for an otherwise non matching activity.


> (No columns were specified in the sample code.)

Yes, regarding lack of sample display_column, we were passing an array to the catsapi.php code - it is not written to handle an array so PHP simply converts the argument to the word "Array".  Apparently CATS was happy to ignore it and give us the default columns, which was good enough for our purpose. I wrote additional code to use the method I saw elsewhere on this forum. This allowed me to see job_order, but that turns out to be a text field:

        &display_column[]=notes&display_column[]=company_name&display_column[]=job_order

I downloaded catsapi.php again yesterday, and it is a functionally exact match for what I downloaded in 2015, so it's still incorrect as to providing the usable display_column[] sequence to the actual https service.

But, again, we can get by with all this as long as the get_activities($JO_ID ...)  will again return activities whose job order number match the JO_ID as it had been doing until after Dec 5.




On Friday, January 13, 2017 at 5:05:29 PM UTC-5, Aaron Baluczynski wrote:
The way I understand it the code is searching for all activities related to a particular job order ID. The bug causes it to return 0 results instead of the correct results. Why do you need the job order ID as a column when you are searching by that value? (No columns were specified in the sample code.)


Bryan Moore

unread,
Jan 13, 2017, 8:31:53 PM1/13/17
to CATS API

Perhaps it was the 'regarding' field that was removed - if this was the numeric field - I see that is not being returned now even though the get_columns API has it as Yes for returned by default

Anyway we don't care what it's called as long as the get_activities($JO_ID, ...) works or get_activities(,,,,, "regarding;isexactly;$JOID")
[ if the number was in 'regarding' ]

Aaron Baluczynski

unread,
Jan 16, 2017, 10:39:14 AM1/16/17
to CATS API
Hi Bryan,

I added a column "job_order_id" to "get_activities" that will make it possible for you to filter directly on job order ID and not have to use the keyword search. The filter looks like: job_order_id;isexactly;#####

Aaron

Bryan Moore

unread,
Jan 17, 2017, 2:27:36 AM1/17/17
to CATS API

This is better than what we were doing. Thanks!
Regards,
Bryan
Reply all
Reply to author
Forward
0 new messages