Alexander Bautz

Forum Replies Created

Viewing 15 posts - 3,751 through 3,765 (of 4,553 total)
  • Author
    Posts
  • in reply to: VLookUp and List View Threshold #11495
    Alexander Bautz
    Keymaster

    Hi,
    You must index the columns you use in your CAML query in the vLookup setup. If you do this, your vLookups should work.

    Please post back how this works out.

    Best regards,
    Alexander

    in reply to: String – merge duplicates #11487
    Alexander Bautz
    Keymaster

    I’ll need to have a close look – could you email me some screenshots of your data-source list and your chart config?

    Alexander

    in reply to: Sum multiple vLookup Total columns #11485
    Alexander Bautz
    Keymaster

    Hi,
    I would advise you to use the “dataObj” instead. I mentioned it above, but all you need to do is to add this code to you custom js:

    My vLookup field is named “vLookupTasks” and the number field I want to total is called “Num” – change the field names to match you own.

    function vLookupIsLoadedCallback(fin){
     if(fin === "vLookupTasks"){
       myTotFunction();
     }
    }
    
    function myTotFunction(){    
      var myTot = 0;  $.each(spjs.vLookup.dataObj.vLookupTasks[GetUrlKeyValue("ID")].items,function(i,item){
          // the number is in display format and needs to be parsed as a proper number
          myTot += Number(item.Num.replace(/[^\d|\.]/g,""));
      });
      console.log(myTot); 
    }

    Please note that this method is only available when the vLookup query has finished – this is why its wrapped in the “vLookupIsLoadedCallback” function.

    Hope this helps,
    Alexander

    in reply to: Edit form on one list causing error on load #11481
    Alexander Bautz
    Keymaster

    Hi,
    This is an error originating from “getFieldValue” on a people picker field. Are you using any custom code which may be calling this function?

    Which version of SharePoint are you using?

    Alexander

    in reply to: List Base URL dynamic #11451
    Alexander Bautz
    Keymaster

    Hi,
    Which version of the vLookup plugin are you using?

    This is an undocumented feature and to be honest, I’m not exactly sure which version I added it in, but if you update to the latest version you should be OK.

    Alexander

    in reply to: String – merge duplicates #11447
    Alexander Bautz
    Keymaster

    Hi,
    This task is now performed by “Grouping” at the bottom of the first tab – check the “Group by first column” – and possibly combine it with “Split options in separate series” if you are charting on a choice column.

    Hope this helps,
    Alexander

    in reply to: v5 Setup #11445
    Alexander Bautz
    Keymaster

    I’m glad you figured it out. You should be able to comment out this file so this is a bug that I’ll fix in the next revision.

    You can use your current jQuery version – no dependencies on the latest version.

    Alexander

    in reply to: List Base URL dynamic #11432
    Alexander Bautz
    Keymaster

    Hi,
    Sorry for the delay. You can put the variable in the custom js like this:

    var vLookupBaseUrlVariable = "/ThePath/To/Your/Site";

    Then use this in the List base URL field in vLookup config:

    {var:vLookupBaseUrlVariable}

    You can chain this together with your static text like this:

    {var:vLookupBaseUrlVariable}/the_rest_of_the_url

    Alexander

    in reply to: vLookups stopped working in list Edit form #11396
    Alexander Bautz
    Keymaster

    Hi,
    Yes this is the reason. When using [currentItem:NameOfField] I pull the value from the field in the form when in EditForm – and a calculated column is not present in EditForm.

    In DispForm I use a query to find all the values, and I’m not sure doing this differently in EditForm makes any sense (you have one more query to perform, but this does not take many milliseconds to complete).

    Try putting the code snippet below in the Custom JS in DFFS of your EditForm to see if it makes any difference. Let me know how it works out so I can update the vLookup script if it performs as expected.

    Alexander

    spjs.vLookup.fillInVariables = function(str,id,listGuid){
    	var split, finID, fin, viewFields, item, val, vArr, q;
    	finID = {};
    	viewFields = [];
    	vArr = str.match(/\[currentItem:[^\]]*\]/gi);
    	if(vArr!==null){
    		spjs.$.each(vArr,function(i,v){
    			split = v.replace(/\[|\]/g,'').split(':');
    			fin = split[1];
    			if(fin!==null){
    				if(fin==='ID'){
    					str = str.split(v).join(id);
    				}else{
    					if(split.length===3){
    						finID[fin]=split[2];
    					}
    					viewFields.push(fin);
    					str = str.split(v).join("~"+fin+"~");
    				}
    			}
    		});
    		if(viewFields.length>0){
    			item = spjs_getItemByID({"listName":listGuid,"id":id,"viewFields":viewFields,"scope":"RecursiveAll"});
    			if(item!==null ){
    				spjs.$.each(viewFields,function(i,fin){
    					val = (item[fin]!==null)?item[fin]:'';
    					vArr = val.split(';#');
    					switch(finID[fin]){
    						case 'id':
    							val = vArr[0];
    						break;
    						default:
    							if(vArr.length>1){
    								val = vArr[1];
    							}else{
    								val = vArr[0];
    							}
    					}
    					str = str.split("~"+fin+"~").join(val);
    				});
    			}
    		}
    	}
    	// URL
    	vArr = str.match(/\[URL:[^\]]*\]/g);
    	if(vArr!==null){
    		spjs.$.each(vArr,function(i,v){
    			split = v.replace(/\[|\]/g,'').split(':');
    			q = split[1];
    			if(q!==null){
    				if(GetUrlKeyValue(q) !== ""){
    					str = str.split(v).join(GetUrlKeyValue(q));
    				}
    			}
    		});
    	}
    	// Variables
    	vArr = str.match(/\{var:[^\}]*\}/g);
    	if(vArr !== null){
    		$.each(vArr,function(i,v){
    			try{
    				val = eval(v.split(":")[1].replace(/\}|\\/g,""));
    				if(val === undefined){
    					alert("[vLookup - undefined variable]\n\n"+v.split(":")[1].replace(/\}|\\/g,""));
    				}else{
    					str = str.split(v).join(val);
    				}
    			}catch(err){
    				alert(err);
    			}
    		});		
    	}
    	return str;
    };
    in reply to: List Base URL dynamic #11391
    Alexander Bautz
    Keymaster

    Hi,
    I’m not sure I understand what you want to do. You can use “{currentSite}” to set the base url to the current sites base url, and then append to this.

    Are you looking to use a JavaScript variable here?

    Alexander

    in reply to: vLookups stopped working in list Edit form #11365
    Alexander Bautz
    Keymaster

    Hi,
    The query is not the same in the two “blobs” above so I’ll have to see a screenshot of the vLookup setup (the CAML query part).

    Alexander

    in reply to: Stay on page after save #11352
    Alexander Bautz
    Keymaster

    Hi Lana – I’m posting the solution we exchanged on email here to maybe help others.

    I’m not sure how this is set up as my test in a web part page will not redirect. You can try adding this to a CEWP / HTML form web part below the form:

    <script type="text/javascript">
    EditItemWithCheckoutAlert = function(a,b,c){
                var dlg, options = {};
                options.url = b;
                options.dialogReturnValueCallback = function(a,b){
                            if(a === 1){
                                        alert("The item was edited");
                            }else{
                                        alert("The dialog was cancelled.")
                            }
                };
                dlg = SP.UI.ModalDialog.showModalDialog(options);
    }
    </script>

    This code will alert the dialog “result” – these alerts must be removed, but they show you how you can do something when the dialog is closed.

    Hope this helps,
    Alexander

    • This reply was modified 7 years, 11 months ago by Alexander Bautz. Reason: fixed missing code snippet
    Alexander Bautz
    Keymaster

    It’s caused by the fact that the root of a discussion is a folder content type. The same is true for a summary task. I’ll fix this in the next revision of DFFS during next week.

    Sorry for the inconvenience.

    Alexander

    Alexander Bautz
    Keymaster

    Which version of SharePoint are you using?

    I did a quick test on a discussion board in in SP2013, and it seems the JSLink loading will not work. I have not looked further into this issue.

    Alexander

    in reply to: vLookups stopped working in list Edit form #11339
    Alexander Bautz
    Keymaster

    I have a hunch it could be the “List base URL”, but if you append “&vLookupDebug=1” to the URL you can “see” the query and the output:

    Example:

    /Lists/DFFS_TestList/DispForm.aspx?ID=123&vLookupDebug=1

    Post the output here.

    Alexander

Viewing 15 posts - 3,751 through 3,765 (of 4,553 total)