is there any tool or webPart to add banners to sharepoint 2013 that support responsiveness?
You don't need anything SP specific. I've used flexslider in the past for SP and otherwise. Just use REST to populate from your list and call flexslider in the ajax success callback.
(Too long for a comment) I do on my other machine - this is a 2010 example where I used SPServices to do the same thing. Same concept - generate your markup with the response data and apply flexslider after the markup is populated.
$(document).ready(function() {
$().SPServices({
operation: "GetListItems",
async: false,
webURL: "/",
listName: "Home Slider",
CAMLViewFields: "<ViewFields><FieldRef Name='ImageLink' /><FieldRef Name='Title' /><FieldRef Name='SubTitle' />"
+ "<FieldRef Name='LinkText' /><FieldRef Name='LinkURL' /><FieldRef Name='Description' />"
+ "</ViewFields>",
completefunc: function (xData, Status) {
var myslider;
var liHtml = "";
$(xData.responseXML).SPFilterNode("z:row").each(function() {
liHtml += "<li style='background:url(" + $(this).attr("ows_ImageLink") + ") no-repeat center top;'>"
+ "<div class='slideWrap'><div class='slideInnerWrap'>"
+ "<h2>" + $(this).attr("ows_Title") + "</h2>"
+ "<a href='" + $(this).attr("ows_LinkURL") + "' class='btn btnOrange btnLarge' >"
+ $(this).attr("ows_LinkText") + "</a>"
+ "</div></div>"
+ "</li>";
});
$("#sliders").append("<ul class='slides'>" + liHtml + "</ul>");
$('.flexslider').flexslider({
directionNav: true,
animation: "slide"
});
}
});
});
Related
I have the script below which extracts the data from MongoDB:
router.get("/visualizarinscritos/:id", eEmpresa, (req,res)=>{
result = []
Vaga.findOne({_id: req.params.id}).then((vaga)=>{
//console.log(Object.values(JSON.parse(JSON.stringify(vaga.candidatos))))
Curriculo.find().then((curriculo)=>{
if(curriculo){
for(var r = 0; r < vaga.candidatos.length ; r++){
for(var i = 0; i < curriculo.length; i++){
if(vaga.candidatos[r] == curriculo[i].usuario){
result.push(curriculo[r])
}
}
}
res.render("empresa/viewcurriculos", {curriculo: result})
}else{
req.flash("error_msg", "Não há curriculos relacionados")
res.redirect("/empresa/vagas")
}
}).catch((err)=>{
req.flash("error_msg", "Houve um erro ao buscar usuários relacionados a vaga: "+err)
res.redirect("/empresa/vagas")
})
}).catch((err)=>{
req.flash("error_msg", "Houve um erro ao carregar vaga: "+err)
res.redirect("/empresa/vagas")
})})
I'm receiving the data as expected. I did a console.log and I'm getting it correctly:
[ {
_id: 60cabfad6494450bd0065877,
usuario: 60cabebfd90f8427c4840990,
experiencia: 'SAP Concur Reporting Analyst\r\n' +
'SAP SE | 07/22/2019 - Current.\r\n' +
'Support and develop reports on IBM Cognos\r\n' +
'\r\n' +
'Support team questions and handle issues\r\n' +
'\r\n' +
'Teach new colleagues\r\n' +
'\r\n' +
'Translate documents to Portuguese, English or Spanish.\r\n' +
'\r\n' +
'Create and support system automations\r\n' +
'\r\n' +
'Trilingual Service Desk Senior\r\n' +
'HCL Technologies | 02/27/2019 – 07/19/2019\r\n' +
'Teach news Service Desk Analyst\r\n' +
'\r\n' +
'Teach and remainder the team about process and new process or applications\r\n' +
'\r\n' +
'Answer the questions that the Analyst of Service Desk can ask\r\n' +
'\r\n' +
'Learn and participate of migrations of new applications\r\n' +
'\r\n' +
'Work on tickets that have a big priority\r\n' +
'\r\n' +
'Help key users solving problems and answering questions\r\n' +
'\r\n' +
'Verify the tickets that Service Desk done something and escalate it if necessary\r\n' +
'\r\n' +
'Bilingual Service Desk\r\n' +
'HCL Technologies | 05/22/2017 – 02/27/2019\r\n' +
'Support on applications that are homologated and used by the client\r\n' +
'\r\n' +
'Remote support on softwares\r\n' +
'\r\n' +
'Support on applications that are homologated and used by the client, O.S, networks and telecom\r\n' +
'\r\n' +
'improve the Knowledge base\r\n' +
'\r\n' +
'Answer emails, calls and chats according the demands\r\n' +
'\r\n' +
'Manage tickets\r\n' +
'\r\n' +
'Internship – Maintenance of computers and networks\r\n' +
'QI Escolas & Faculdades | 09/14/2016 - 05/18/2017\r\n' +
'Administrative routines\r\n' +
'\r\n' +
'Servers maintenance\r\n' +
'\r\n' +
'Maintenance of cabling and switch\r\n' +
'\r\n' +
'Remote support on applications\r\n' +
'\r\n' +
'Local support on hardware and Telecom area.',
educacao: 'Associate in Analysis and Systems Development\r\n' +
'Unisinos | 2017/2 - Current.\r\n' +
'\r\n' +
'IT\r\n' +
'QI Escolas & Faculdades | Completed at 2017',
certificacao: '>\r\n' +
'ITIL\r\n' +
'\r\n' +
'>\r\n' +
'Active Directory\r\n' +
'\r\n' +
'>\r\n' +
'Exchange\r\n' +
'\r\n' +
'>\r\n' +
'Windows Server and OS\r\n' +
'\r\n' +
'>\r\n' +
'Network maintenance/management\r\n' +
'\r\n' +
'>\r\n' +
'Hardware',
idioma: 'Porguese\r\n\r\nEnglish\r\n\r\nSpanish\r\n\r\nLIBRAS',
habilidades: 'Java\r\n' +
'\r\n' +
'SQL\r\n' +
'\r\n' +
'HTML/CSS\r\n' +
'\r\n' +
'JavaScript\r\n' +
'\r\n' +
'EJS\r\n' +
'\r\n' +
'NodeJS\r\n' +
'\r\n' +
'Android\r\n' +
'\r\n' +
'Angular\r\n' +
'\r\n' +
'PHP\r\n' +
'\r\n' +
'Cognos',
outros: 'Github: https://github.com/gabdonada\r\n\r\nFuncionou?',
__v: 0},undefined]
However, when trying to get the data using the Handlebars code below, the page is not showing values:
{{#each curriculo}}
<div class="card">
<div class="card-body">
<h4>{{curriculo.usuario.nome}}</h4>
<h4>{{experiencia}}</h4>
<small>Sobre: {{curriculo.experiencia}}</small><br>
<button class="btn btn-success">Visualizar Curriculo</button>
</div>
</div>
{{else}}
<h4>Não há curriculos registrados</h4>
{{/each}}
I tried by using and not using Each, but still not working. Do you know how to fix this?
Within an #each block, you need to use this to access the current array item. Therefore you should change your code to:
{{#each curriculo}}
<div class="card">
<div class="card-body">
<h4>{{this.usuario.nome}}</h4>
<small>Sobre: {{this.experiencia}}</small><br>
<button class="btn btn-success">Visualizar Curriculo</button>
</div>
</div>
{{else}}
<h4>Não há curriculos registrados</h4>
{{/each}}
The solution for this case is adding Async + Promise, as below. The res.render was redirecting to the page before the code completes. I also used .lean():
Router.get("/visualizarinscritos/:id", eEmpresa, (req,res)=>{
var result = []
Vaga.findOne({_id: req.params.id}).lean().then((vaga)=>{
Curriculo.find().lean().then( async (curriculos)=>{
if(curriculos){
const promises = []
for(const candidato of vaga.candidatos){
for(const curriculo of curriculos ){
promises.push(
new Promise((resolve) => {
if(candidato == curriculo.usuario){
result.push(curriculo)
}
resolve(candidato)
})
)
}
}
Promise.all(promises).then((resposta) => {
console.log(result)
console.log(result.usuario)
res.render("empresa/viewcurriculos", {teste: result})
})
}else{
req.flash("error_msg", "Não há curriculos relacionados")
res.redirect("/empresa/vagas")
}
}).catch((err)=>{
req.flash("error_msg", "Houve um erro ao buscar usuários relacionados a vaga: "+err)
res.redirect("/empresa/vagas")
})
}).catch((err)=>{
req.flash("error_msg", "Houve um erro ao carregar vaga: "+err)
res.redirect("/empresa/vagas")
})
})
I have been on a CRM 2011 project that uses a lot of custom views.
I recently figured it out that all lookup custom views are only working properly in the internet explorer. When I try using google chrome (Version 51.0.2704.84 m) it simple does not work.
I googled without luck.
Is anyone aware about how to solve that issue?
I'm sure many of you have faced the same problem.
Here is my code. I emphasize that it works like a charm in IE.
var viewId = "{1DFB2B35-B07C-44D1-868D-258DEEAB88E1}";
var entityName = "tz_tipodefrete";
var viewDisplayName = "Tipos de Frete Disponíveis";
var fetchXml =
"<fetch distinct='false' mapping='logical' output-format='xml-platform' version='1.0'>" +
"<entity name='tz_tipodefrete'>" +
"<attribute name='tz_name'/>" +
"<order descending='false' attribute='tz_ordem'/>" +
"<filter type='and'>";
if (filtrar)
fetchXml = fetchXml + "<condition attribute='tz_name' value='Cliente Retira e instala no CT' operator='ne'/>";
fetchXml = fetchXml +
"<condition attribute='statecode' value='0' operator='eq'/>" +
"</filter>" +
"</entity>" +
"</fetch>";
// build Grid Layout
var layoutXml = "<grid name='resultset' object='1' jump='tz_name' select='1' icon='1' preview='1'>" +
"<row name='result' id='tz_tipodefreteid'>" +
"<cell name='tz_name' width='600' />" +
"</row>" +
"</grid>";
Xrm.Page.getControl("tz_tipodefrete").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, true);
//Desabilita a opção do usuário trocar de view. Provável que pare de funcionar na migração para versão 2015
document.getElementById("tz_tipodefrete").setAttribute("disableViewPicker", "1");
Have you tried taking the brackets off the guid?
Ex. var viewId = "1DFB2B35-B07C-44D1-868D-258DEEAB88E1";
In some situations, that helps.
I'm having trouble getting a user's info using SP Services from a sub-site. Using the code below I get the error There are multiple root elements.
var employeeName = $(this).attr('ows_Employee');
var employeeInfoViewFields = '<ViewFields>\
<FieldRef Name="Title" />\
<FieldRef Name="Department" />\
<FieldRef Name="JobTitle" />\
</ViewFields>\
<Where>\
<Eq>\
<FieldRef Name="Title" />\
<Value Type="Text">' + employeeName + '</Value>\
</Eq>\
</Where>';
$().SPServices({
operation: 'GetListItems',
async: false,
listName: 'UserInfo',
// listName: 'User Information List',
CAMLViewFields: employeeInfoViewFields,
completefunc: function(xData, Status) {
// Do stuff
}
});
I eventually replaced SPServices with a standard ajax call. This works perfectly.
$.ajax({
url: "/_api/lists/getbytitle('User Information List')/items?$filter=Title eq '" + employeeName + "'&$select=Department,JobTitle",
type: "GET",
async: false,
success: function (xml) {
department = $(xml).find('d\\:Department, Department').text();
jobTitle = $(xml).find('d\\:JobTitle, JobTitle').text();
},
error: function (a, b, c) {
alert(c);
}
});
I have a text field labeled "RecipientName" in my template. I am trying to populate that field before sending to receipient. But it doesn't populate. I am using "DocuSign API - Signature Request from Template". I don't get any error, but it doesn't populate the field. Please help!
Here is my request Body & url
string url = "https://demo.docusign.net/restapi/v2" + "/accounts/" + accountId + "/envelopes";
string requestBody =
"<envelopeDefinition xmlns=\"http://www.docusign.com/restapi\">" +
"<status>sent</status>" +
"<emailSubject>DocuSign API - Signature Request from Template</emailSubject>" +
"<templateId>" + templateId + "</templateId>" +
"<templateRoles>" +
"<templateRole>" +
"<name>" + recipientName + "</name>" +
"<email>" + recipientEmail + "</email>" +
"<roleName>" + templateRole + "</roleName>" +
"<tabs>" +
"<textTabs>" +
"<tabLabel>RecipientName</tabLabel>" +
"<name>RecipientName</name>" +
"<value>Recepient Test</value>" +
"</textTabs>" +
"</tabs>" +
"</templateRole>" +
"</templateRoles>" +
"</envelopeDefinition>";
You're missing the inner <text> xml tag for your tab. Try this:
<textTabs>
<text>
<tabLabel>RecipientName</tabLabel>
<value>RecipientName</value>
</text>
</textTabs>
This should work, though as Andrew mentioned you should really just use the Name tag if you're trying to display the recipient's name.
What i need is to find all list items with the same title using SPServices. I've made a CAML query from TextBox1 but have no idea what to do next. My question is: how do I change this code to accomplish my goal?
<script language="javascript" type="text/javascript">
function GetTitleMatch()
{
var Tit = $("#TextBox1").val();
$().SPServices({
operation:"GetListItems",
listName:"CustomList",
async:false,
CAMLViewFields: "<ViewFields>"+
"<FieldRef Name='Title'/>"+
"<ViewFields>",
CAMLQuery:"<Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>" + Tit + "</Value></Eq></Where></Query>",
completefunc:function(xData,status)
{
alert($(xData.responseXML).find('[nodeName="z\\:row"]').length);
}
});
}
</script>
click
If anyone cares, the complete code should loock something like this:
<script language="javascript" type="text/javascript">
function GetTitleMatch()
{
var Tit = $(".TextBox1").val();
alert(Tit);
var itemCount=0;
var queryText = "<Query><Where><Eq><FieldRef Name='Title'/><Value Type='Text'>" + Tit + "</Value></Eq></Where></Query>";
alert(queryText);
$().SPServices({
operation: "GetListItems",
listName: "CustomList",
async: false,
CAMLQuery: queryText,
completefunc: function (xData, status) {
alert(xData.responseXML.xml);
itemCount = $(xData.responseXML.xml).find("rs\\:data, data").attr("ItemCount");
alert(itemCount);
$(".TextBox3").val(itemCount);
}
});
}
</script>
<a onclick="javascript:GetTitleMatch();">click</a>
All I neded to do was use .attr("ItemCount")