Tag Archives: SharePoint Obter Anexos

Obtém anexos de Lista SharePoint

Function para obter a lista de anexos de uma lista no SharePoint. [js] function ObtemAnexos(listItem) { var ctx = listItem.get_context(); var attachmentFolderUrl = String.format(‘{0}/Attachments/{1}’,listItem.get_fieldValues()[‘FileDirRef’],listItem.get_fieldValues()[‘ID’]); var folder = ctx.get_web().getFolderByServerRelativeUrl(attachmentFolderUrl); var files = folder.get_files(); ctx.load(files); ctx.executeQueryAsync( function () { var attachments = []; for (var i = 0; file = files.get_item(i) ; i++) { attachments.push({url: file.get_serverRelativeUrl(), name: […]

<span class="entry-utility-prep entry-utility-prep-cat-links">Posted in</span> JavaScript, JQuery, SharePoint | <span class="entry-utility-prep entry-utility-prep-tag-links">Tagged</span> , , , , | Leave a comment