{"id":296,"date":"2017-09-12T14:55:25","date_gmt":"2017-09-12T17:55:25","guid":{"rendered":"http:\/\/www.ctasoftware.com.br\/blog\/?p=296"},"modified":"2017-09-06T14:59:02","modified_gmt":"2017-09-06T17:59:02","slug":"obtem-anexos-de-lista-sharepoint","status":"publish","type":"post","link":"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/","title":{"rendered":"Obt\u00e9m anexos de Lista SharePoint"},"content":{"rendered":"<p>Function para obter a lista de anexos de uma lista no SharePoint.<\/p>\n<p>[js]<br \/>\nfunction ObtemAnexos(listItem) {<br \/>\n    var ctx = listItem.get_context();<br \/>\n    var attachmentFolderUrl = String.format(&#8216;{0}\/Attachments\/{1}&#8217;,listItem.get_fieldValues()[&#8216;FileDirRef&#8217;],listItem.get_fieldValues()[&#8216;ID&#8217;]);<br \/>\n    var folder = ctx.get_web().getFolderByServerRelativeUrl(attachmentFolderUrl);<br \/>\n    var files = folder.get_files();<br \/>\n    ctx.load(files);<\/p>\n<p>    ctx.executeQueryAsync(<br \/>\n       function () {<br \/>\n          var attachments = [];<br \/>\n          for (var i = 0; file = files.get_item(i) ; i++)<br \/>\n          {<br \/>\n              attachments.push({url: file.get_serverRelativeUrl(), name: file.get_name()});<br \/>\n          }<br \/>\n          return attachments;<br \/>\n    });<br \/>\n}<br \/>\n[\/js]<\/p>\n<p>Caso queira montar uma div com os anexos<\/p>\n<p>[js]<br \/>\nfunction ObtemAnexos(listItem) {<br \/>\n    var ctx = listItem.get_context();<br \/>\n    var attachmentFolderUrl = String.format(&#8216;{0}\/Attachments\/{1}&#8217;,listItem.get_fieldValues()[&#8216;FileDirRef&#8217;],listItem.get_fieldValues()[&#8216;ID&#8217;]);<br \/>\n    var folder = ctx.get_web().getFolderByServerRelativeUrl(attachmentFolderUrl);<br \/>\n    var files = folder.get_files();<br \/>\n    ctx.load(files);<\/p>\n<p>    ctx.executeQueryAsync(<br \/>\n       function () {<br \/>\n          var attachments = [];<br \/>\n          htmlAnexo = &#8216;<\/p>\n<div id=\"idAnexosCampanhas\">&#8216;;<br \/>\n          for (var i = 0; file = files.get_item(i) ; i++)<br \/>\n          {<br \/>\n              attachments.push({url: file.get_serverRelativeUrl(), name: file.get_name()});<br \/>\n              htmlAnexo += &#8216;<a href=\"' + file.get_serverRelativeUrl() + '\" target=\"_blank\">&#8216; + file.get_name() + &#8216;<\/a><br \/>&#8216;;<br \/>\n          }<br \/>\n          htmlAnexo += &#8220;<\/div>\n<p>&#8220;;<br \/>\n          var xxx = listItem.get_fieldValues()[&#8216;ID&#8217;];<br \/>\n          if(htmlAnexo != undefined){<br \/>\n\t        $(&#8216;[id^=&#8221;idAnexoCampanha&#8221;]&#8217;).html(htmlAnexo);<br \/>\n\t      }<br \/>\n\t      $(&#8216;body&#8217;).append(htmlAnexo);<\/p>\n<p>          return attachments;<br \/>\n    });<br \/>\n}<br \/>\n[\/js]<\/p>\n<p>At\u00e9 a pr\u00f3xima<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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(&#8216;{0}\/Attachments\/{1}&#8217;,listItem.get_fieldValues()[&#8216;FileDirRef&#8217;],listItem.get_fieldValues()[&#8216;ID&#8217;]); 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: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[52,55,26],"tags":[82,44,83,74,84],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Obt\u00e9m anexos de Lista SharePoint - CTASoftware Blog<\/title>\n<meta name=\"description\" content=\"CTASoftware Blog Obt\u00e9m anexos de Lista SharePoint\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Obt\u00e9m anexos de Lista SharePoint - CTASoftware Blog\" \/>\n<meta property=\"og:description\" content=\"CTASoftware Blog Obt\u00e9m anexos de Lista SharePoint\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/\" \/>\n<meta property=\"og:site_name\" content=\"CTASoftware Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-09-12T17:55:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-09-06T17:59:02+00:00\" \/>\n<meta name=\"author\" content=\"Everton Gon\u00e7alves\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Everton Gon\u00e7alves\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/\"},\"author\":{\"name\":\"Everton Gon\u00e7alves\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/34f7fa2c76834d8410f6dd43e26fd3e4\"},\"headline\":\"Obt\u00e9m anexos de Lista SharePoint\",\"datePublished\":\"2017-09-12T17:55:25+00:00\",\"dateModified\":\"2017-09-06T17:59:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/\"},\"wordCount\":190,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#organization\"},\"keywords\":[\"Anexos SharePoint\",\"SharePoint\",\"SharePoint JavaScript\",\"SharePoint Jquery\",\"SharePoint Obter Anexos\"],\"articleSection\":[\"JavaScript\",\"JQuery\",\"SharePoint\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/\",\"url\":\"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/\",\"name\":\"Obt\u00e9m anexos de Lista SharePoint - CTASoftware Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#website\"},\"datePublished\":\"2017-09-12T17:55:25+00:00\",\"dateModified\":\"2017-09-06T17:59:02+00:00\",\"description\":\"CTASoftware Blog Obt\u00e9m anexos de Lista SharePoint\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/www.ctasoftware.com.br\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Obt\u00e9m anexos de Lista SharePoint\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#website\",\"url\":\"https:\/\/www.ctasoftware.com.br\/blog\/\",\"name\":\"CTASoftware Blog\",\"description\":\"Para Desenvolvedores De Software\",\"publisher\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ctasoftware.com.br\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#organization\",\"name\":\"CTASoftware\",\"url\":\"https:\/\/www.ctasoftware.com.br\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2023\/06\/logocta.png?fit=225%2C44&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2023\/06\/logocta.png?fit=225%2C44&ssl=1\",\"width\":225,\"height\":44,\"caption\":\"CTASoftware\"},\"image\":{\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/34f7fa2c76834d8410f6dd43e26fd3e4\",\"name\":\"Everton Gon\u00e7alves\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3e5e7fe964521f618a2b09d3fbb7800f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3e5e7fe964521f618a2b09d3fbb7800f?s=96&d=mm&r=g\",\"caption\":\"Everton Gon\u00e7alves\"},\"description\":\"http:\/\/www.ctasoftware.com.br\",\"sameAs\":[\"http:\/\/www.ctasoftware.com.br\"],\"url\":\"https:\/\/www.ctasoftware.com.br\/blog\/author\/everton-goncalves\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Obt\u00e9m anexos de Lista SharePoint - CTASoftware Blog","description":"CTASoftware Blog Obt\u00e9m anexos de Lista SharePoint","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/","og_locale":"pt_BR","og_type":"article","og_title":"Obt\u00e9m anexos de Lista SharePoint - CTASoftware Blog","og_description":"CTASoftware Blog Obt\u00e9m anexos de Lista SharePoint","og_url":"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/","og_site_name":"CTASoftware Blog","article_published_time":"2017-09-12T17:55:25+00:00","article_modified_time":"2017-09-06T17:59:02+00:00","author":"Everton Gon\u00e7alves","twitter_misc":{"Escrito por":"Everton Gon\u00e7alves","Est. tempo de leitura":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/#article","isPartOf":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/"},"author":{"name":"Everton Gon\u00e7alves","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/34f7fa2c76834d8410f6dd43e26fd3e4"},"headline":"Obt\u00e9m anexos de Lista SharePoint","datePublished":"2017-09-12T17:55:25+00:00","dateModified":"2017-09-06T17:59:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/"},"wordCount":190,"commentCount":0,"publisher":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/#organization"},"keywords":["Anexos SharePoint","SharePoint","SharePoint JavaScript","SharePoint Jquery","SharePoint Obter Anexos"],"articleSection":["JavaScript","JQuery","SharePoint"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/","url":"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/","name":"Obt\u00e9m anexos de Lista SharePoint - CTASoftware Blog","isPartOf":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/#website"},"datePublished":"2017-09-12T17:55:25+00:00","dateModified":"2017-09-06T17:59:02+00:00","description":"CTASoftware Blog Obt\u00e9m anexos de Lista SharePoint","breadcrumb":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ctasoftware.com.br\/blog\/obtem-anexos-de-lista-sharepoint\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/www.ctasoftware.com.br\/blog\/"},{"@type":"ListItem","position":2,"name":"Obt\u00e9m anexos de Lista SharePoint"}]},{"@type":"WebSite","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#website","url":"https:\/\/www.ctasoftware.com.br\/blog\/","name":"CTASoftware Blog","description":"Para Desenvolvedores De Software","publisher":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ctasoftware.com.br\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#organization","name":"CTASoftware","url":"https:\/\/www.ctasoftware.com.br\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2023\/06\/logocta.png?fit=225%2C44&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.ctasoftware.com.br\/blog\/wp-content\/uploads\/2023\/06\/logocta.png?fit=225%2C44&ssl=1","width":225,"height":44,"caption":"CTASoftware"},"image":{"@id":"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/34f7fa2c76834d8410f6dd43e26fd3e4","name":"Everton Gon\u00e7alves","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.ctasoftware.com.br\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3e5e7fe964521f618a2b09d3fbb7800f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3e5e7fe964521f618a2b09d3fbb7800f?s=96&d=mm&r=g","caption":"Everton Gon\u00e7alves"},"description":"http:\/\/www.ctasoftware.com.br","sameAs":["http:\/\/www.ctasoftware.com.br"],"url":"https:\/\/www.ctasoftware.com.br\/blog\/author\/everton-goncalves\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6ACmG-4M","jetpack-related-posts":[{"id":300,"url":"https:\/\/www.ctasoftware.com.br\/blog\/obter-itens-de-lista-sharepoint-jquery\/","url_meta":{"origin":296,"position":0},"title":"Obter Itens de Lista SharePoint JQuery","author":"Everton Gon\u00e7alves","date":"17 de setembro de 2017","format":false,"excerpt":"Obt\u00e9m os itens da lista no SharePoint AJAX. [js] function AtualizaFinalizaTarefa() { var urlSite = _spPageContextInfo.siteAbsoluteUrl; var tituloSolicitacao = $('[id^=\"Title_\"]').val(); var idSolicitacao = parseInt(GetUrlKeyValue('ID')); var listaSiteProjetos = \"\/_api\/Web\/Lists\/getbytitle('Tarefas')\/items?$filter=IdSolicitacao eq '\" + idSolicitacao + \"'\"; var url = urlSite + listaSiteProjetos; $.ajax({ url: url, type: \"GET\", headers: {\"accept\": \"application\/json;odata=verbose\"}, success: function(data){\u2026","rel":"","context":"Em &quot;SharePoint&quot;","block_context":{"text":"SharePoint","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/sharepoint\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":294,"url":"https:\/\/www.ctasoftware.com.br\/blog\/obter-usuario-por-id-sharepoint\/","url_meta":{"origin":296,"position":1},"title":"Obter Usu\u00e1rio Por Id SharePoint","author":"Everton Gon\u00e7alves","date":"8 de setembro de 2017","format":false,"excerpt":"Obt\u00eam o usu\u00e1rio pelo ID no SharePoint atrav\u00e9s do JQuery. [js] function getUserById(ID) { var context = new SP.ClientContext.get_current(); var user = context.get_web().get_siteUsers().getById(ID); context.load(user); context.executeQueryAsync( Function.createDelegate(null, ensureUserSuccess), Function.createDelegate(null, onFail) ); function ensureUserSuccess() { login = user.get_loginName(); nome = user.get_title(); } function onFail() { console.log('error'); } } [\/js] At\u00e9 a pr\u00f3xima","rel":"","context":"Em &quot;JavaScript&quot;","block_context":{"text":"JavaScript","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/javascript\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":292,"url":"https:\/\/www.ctasoftware.com.br\/blog\/obter-dados-usuario-logado-sharepoint-jquery-ajax\/","url_meta":{"origin":296,"position":2},"title":"Obter Dados Usu\u00e1rio Logado SharePoint Jquery Ajax","author":"Everton Gon\u00e7alves","date":"7 de setembro de 2017","format":false,"excerpt":"M\u00e9todo \u00fatil para obter os dados do usu\u00e1rio autenticado no SharePoint. [js] var currentUserDetails = Array(); function getCurrentUserWithDetails() { var endpointUrl = _spPageContextInfo.webAbsoluteUrl + '\/_api\/web\/currentuser\/?$expand=groups&$select=groups\/LoginName, LoginName,Title,Email'; $.ajax({ url: endpointUrl, method: \"GET\", contentType: \"application\/json;odata=verbose\", headers: { \"Accept\": \"application\/json;odata=verbose\" }, async:true, success: function(data){ var groups =[]; $.each(data.d.Groups.results, function (key, value) { groups.push(value.LoginName);\u2026","rel":"","context":"Em &quot;JavaScript&quot;","block_context":{"text":"JavaScript","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/javascript\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":298,"url":"https:\/\/www.ctasoftware.com.br\/blog\/atualizar-list-item-sharepoint\/","url_meta":{"origin":296,"position":3},"title":"Atualizar List Item SharePoint","author":"Everton Gon\u00e7alves","date":"16 de setembro de 2017","format":false,"excerpt":"Fun\u00e7\u00e3o para atualizar item em uma lista no SharePoint. [js] function updateMetadata(id) { var url = _spPageContextInfo.webAbsoluteUrl + \"\/_api\/Web\/Lists\/getByTitle('Tarefas')\/Items(\" + id + \")\"; var dfd = $.Deferred(); var campo1 = 'Dados novos'; var campo2 = 'Dados novos 2'; $.ajax({ 'url': url, 'method': 'POST', 'data': JSON.stringify({ '__metadata': {'type':'SP.ListItem'}, 'Status': campo1, 'campo2':\u2026","rel":"","context":"Em &quot;JavaScript&quot;","block_context":{"text":"JavaScript","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/javascript\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":290,"url":"https:\/\/www.ctasoftware.com.br\/blog\/verificar-se-tem-anexo-sharepoint-2013\/","url_meta":{"origin":296,"position":4},"title":"Verificar se Tem Anexo SharePoint 2013","author":"Everton Gon\u00e7alves","date":"6 de setembro de 2017","format":false,"excerpt":"M\u00e9todo para verificar se tem anexo na lista SharePoint. [js] function VerificaSeTemAnexo(){ var existeArquivo = false; $('#idAttachmentsTable').find('tbody').find('tr').each(function () { existeArquivo = true; }); return existeArquivo; } [\/js] Inclua esse m\u00e9todo no PreSave() do seu .js para bloquear caso n\u00e3o tenha sido inserido um anexo. At\u00e9 a Pr\u00f3xima!","rel":"","context":"Em &quot;JavaScript&quot;","block_context":{"text":"JavaScript","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/javascript\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":279,"url":"https:\/\/www.ctasoftware.com.br\/blog\/consulta-outra-lista-ajax-sharepoint\/","url_meta":{"origin":296,"position":5},"title":"Consulta Outra Lista Ajax SharePoint","author":"Everton Gon\u00e7alves","date":"22 de agosto de 2017","format":false,"excerpt":"Consultando em outra lista e montando uma tabela atrav\u00e9s de AJAX\/Jquery SharePoint. No exemplo abaixo mostro como pesquisar na lista Projetos e exibir em uma div HTML. Filtro pelo status \"Em andamento\" e ordeno pela data de cria\u00e7\u00e3o do item. [js] function Projetos(){ var urlSite = _spPageContextInfo.siteAbsoluteUrl; var obj; var\u2026","rel":"","context":"Em &quot;SharePoint&quot;","block_context":{"text":"SharePoint","link":"https:\/\/www.ctasoftware.com.br\/blog\/category\/sharepoint\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/posts\/296"}],"collection":[{"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/comments?post=296"}],"version-history":[{"count":1,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/posts\/296\/revisions"}],"predecessor-version":[{"id":297,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/posts\/296\/revisions\/297"}],"wp:attachment":[{"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/media?parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/categories?post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ctasoftware.com.br\/blog\/wp-json\/wp\/v2\/tags?post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}