SP Service extension, is a extension to SP Services javascript library, and can be used more easily to debug javascript.
For example, if we had a sharepoint list called, 'AnnouncementCategory'. Then in google chrome console, we would just type in the following the retrieve the iteams in AnnouncementCategory list:
DEBUG_SPHelper.get_all_spList_items_as_XML('AnnouncementCategory')
This tool is really handy for simple queries. some of the functions are:
DEBUG_SPHelper.does_splist_exist(spListName)
DEBUG_SPHelper.add_splist(spListName, optusListDescription, optusListTemplateID)
DEBUG_SPHelper.get_splist_description(spListName)
DEBUG_SPHelper.get_splist_items_as_XML(spListName, CAMLQuery)
DEBUG_SPHelper.get_all_spList_items_as_XML(spListName, camlViewFields)
DEBUG_SPHelper.update_spList_new_fields(spListName, spNewfields)
DEBUG_SPHelper.batch_to_spList_item(spListName, batchCommand)
DEBUG_SPHelper.get_spList(spListName)
DEBUG_SPHelper.get_spList_fields(spListName)
DEBUG_SPHelper.get_spView_collection(spListName)
DEBUG_SPHelper.get_spView_GUID(spListName, spViewName)
DEBUG_SPHelper.update_spView(spListName, spViewName, spViewFields)
DEBUG_SPHelper.does_fields_in_spList_exist(spListName, spListFields)
DEBUG_SPHelper.get_array_from_XML(xmlData, arrayColumns)
DEBUG_SPHelper.CAML_new_item_batch(fieldNamesAndValues)
DEBUG_SPHelper.CAML_update_item_batch(listItemID, fieldNamesAndValues)
DEBUG_SPHelper.CAML_delete_item_batch(listItemID)
DEBUG_SPHelper.add_fields_to_spListView(spListName, spViewName, fieldsArray)
DEBUG_SPHelper.get_object_from_XML(xmlData, arrayColumns)
DEBUG_SPHelper.does_object_contain_items(objList)
Here are the steps below to get DEBUG_SPHelper working:
Step 1:
download SPServices, and download sharepoint-helper.js, and upload that file to the required SharePoint site.
Step 2:
Using sharepoint designer, add the link reference in the master page.
Remember:
JQuery file and SPServices javascript file has to be linked first in scripts before sharepoint-helper javascript file.
Step 3:
Open google chrome console, and type in the following:
DEBUG_SPHelper.get_all_spList_items_as_XML('<your sharepoint list name>')
Please replace <your sharepoint list name> with the sharepoint list name you want to query:
DEBUG_SPHelper.get_all_spList_items_as_XML('AnnouncementCategory')
No comments:
Post a Comment