Question Number Widget API

This widget can be used to display a single Question Number from within your RefTracker version.

The first step is to make sure that you are including jQuery on your page, and that you are also calling the Widget API function, as explained on this page.

Wherever the API needs to display, simply create a unique ID for an element to populate with the Search widget, and then call the refTrackerQNo plugin:

refTrackerSearch plugin

1234567891011121314151617181920 // id can be anything - as long as it's also referenced in the below script<div id="RefTrackerWidget"></div>  ... // Somewhere further down - near the bottom of the page, but before the </body> element<script type="text/javascript">    (function () {         // Make sure that you specify the same id here as above!        $("#RefTrackerQuestion").refTrackerQNo({            questionNo: 'PROB7031',        });     })(); </script>  

 The RefTracker API has a specific set of limitations associated with it – starting page number, database selection, returned results, etc. This plugin adheres to those limitations in it’s calls unless the calls are overidden. The major difference between this widget and other API widgets is that you must specify the desired Question Number in order to retrieve the correct result.

Overwriting Default Values

This plugin allows for optionally overriding the call to the API. This allows for any number of values to be passed, either optionally, or in your javascript call. The following default values can be overriden:

KeyDescriptionExample
addressget all questions where client address fields contain search term“address”:”123 example”
categoryget all questions assciated with the specified categories Id(s)“category”:”10|3″
clientLocationget all questions where client location is specified id“clientLocation”:”40″
clientNameget all questions where client name fields contain search term“clientName”:”alex”
dbSpecifies database to Search: 
1=Open Questions
2=KB
3=FAQ
“db”:”1″
dateclassSpecifies receipt date range relative to now:
today=1000
yesterday=1100
thisweek=2000
lastweek=2100
thismonth=3000
lastmonth = 3100
thisquarter=4000
lastquarter=4100
thisyear=6000
lastyear=6100
“dateclass”:”3000″
emailget all questions where client email fields contain search term“email”:”info”
phoneget all questions where client phone fields contain search term“phone”:”123″
questionNoget all questions where question number matches specified parms.
Beginning question Number
part question number with wild card
beginning and end question no

“questionNo”,”PROB1234″  
“questionNo”,”PROB12*”   
“questionNo”,”PROB1234|PROB3333″  
requestFormget all questions with specified request form ID(s)“requestForm”:”7|3″
requestGroupget all questions with specified request group ID(s)“requestGroup”:”5|1″
requestTypeget all questions with specified request type ID(s)“requestType”:”114|120″
staffget all question for specified staff ID“staff”:”25″
staffLocationget all questions where staff location is specified id“staffLocation”:”1″
statusget all questions for specified status ID“status”:”010″
statusGroupget all questions for specified statusGroup ID(s)“statusGroup”:”100|600″
scopeListquestion = 100
answer = 200 
client = 300 
bib_ill = 400 
Note = 500 
attachment = 600
“scopeList”:”100|200″
text       This is set to empty in the base version of this API“text”:””
columnListspecifies list of columns to be returned
These can be any data dictionary item, including custom ones
“columnList”:”question_no|question_text|question_answer”
expanswerattsInclude answer attachments“expansweratts”:”1″
expcategoriesInclude categories string“expcategories”:”1″
expjournaltotalsInclude journal total fields“expjournaltotals”:”1″
expquestionattsInclude question attachments“expquestionatts”:”1″
expresourcesInclude resources string“expresources”:”1″
expnotesInclude notes“expnotes”:”1”
pageNumberWhich page to retrieve“pagenumber”:”1″
pageSizeNumber of records per page“pagesize”:”10″
sortByResponseDate = 1 
ReceivedDate = 2 
ClosedDate = 3  
FAQDate = 8  
KBDate = 9  
questionNo = 50
“sortby”:”50″
sortOrderOrder of sort  ASC DESC“sortorder”:”ASC”

To override any of these values, pass along a defaulted parameter in your call to the RefTracker Search function:Updating API Default values

1234567891011$("#RefTrackerWidget").refTrackerQNo({    db:3,    questionNumber:"ABC123",    columnList:"client_email|client_department|question_text",    pagesize:25,    scopelist:100,    requestGroup:5});// the above jQuery call will override the default values with the same corresponding key names

One quick note about the columnList field: not only does it determine which fields get returned, it also determines the order of the fields returned. So, for example, if you’d returned the above, each record returned would include the client_email field, then the client_department field, and then the question_text field, assuming there was data to return in each record. If you instead needed the question_text field to display first in the record’s listing, include it first in your columnList parameter.

Displaying Search Results

As this is a simplified approach in providing a working with the RefTracker search API, it does have it’s limitations. Each returned record is currently being stored in a <div></div> HTML element. For styling / javascript purposes, you can access an individual record based on the record number that’s been returned:

Additionally, you’ll be able to easily style your returned layout, because each element returned will be in a <div></div> HTML element with the class name equal to the data dictionary name. This way, you can have all of the emails, questions, answers, dates – whatever data you return, can be accessed with the same value.

If you have any questions, please don’t hesitate to reach out to your RefTracker support staff member.