Hide "Add New" vLookup button based on query results
- This topic has 2 replies, 2 voices, and was last updated 9 years, 2 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Home › Forums › vLooup for SharePoint › Hide "Add New" vLookup button based on query results
Does anyone know of a way to hide the “add new item” button in vLookup based on the query results? My use case: If an item already exists matching the query, disable the button so that another item is not added, limiting the user to one entry per query.
There is no built in function you can use, but maybe you can use something like this:
var vLookupHideNewItemBtnTicker = setInterval(function(){
if(spjs.vLookup.dataObj.vLookupTasks !== undefined){
if(spjs.vLookup.dataObj.vLookupTasks[spjs.dffs.data.thisItemID].count > 0){
jQspjs("#newItemWrap_vLookupTasks").hide();
clearInterval(vLookupHideNewItemBtnTicker);
}
}
},1000);
Change “vLookupTasks” to match your field name.
Alexander
GENIUS!