I've a custom action on the CommandUI.Ribbon. It triggers a SharePoint add-in and sends the ListID allong as parameter.
In the Add-in page, I try to upload a document (from a rest service).
When I try to get the document library by it's ID, it steps out of the debugger and I have no clue why.
var ctx = SP.ClientContext.get_current();
var fileCreateInfo = new SP.FileCreationInformation();
fileCreateInfo.set_url(documentName);
fileCreateInfo.set_overwrite(true);
fileCreateInfo.set_content(content);
var parentList = ctx.get_web().get_lists().getById(listId); //steps out here.
Is it possible that the getById method doesn't exist?
Hope to hear from you guys and girls...