Quantcast
Channel: SharePoint JavaScripts
Viewing all 391 articles
Browse latest View live

DFFS: Check out list items

$
0
0
Change log
May 06, 2015
Changed the function “goToDispForm” to include “dffs_beforeunload = false;” to prevent check-in when a user was redirected to DispForm.

May 05, 2015
Updated code example to handle check in if the user cancels out of the EditForm without saving changes (and thus not being asked to check in the list item. Please adapt the code to suite your needs.

This post will describe a possible solution to handle check out of list items when editing. This will prevent others from making changes to the list item while another person has the same item already open in EditForm.

This solution is intended used in EditForm, and requires you to add one new field to the list: A yes/no column named (for example) “CheckedOut”.

Currently this requires four rules added to DFFS, but I might consider building in support for this so that this would just require a “tick in a box” to enable.

These are the rules required in DFFS


IMG


IMG


IMG

Please note that you must have DFFS frontend v4.267 or later to be able to “alert” the name of the Editor like in this example.


IMG

The code from the CSS and JS tab in DFFS backend
var dffs_beforeunload = true;

function goToDispForm(){
	dffs_beforeunload = false;
	$("#part1").hide();
	location.href = location.href.replace(/editform.aspx/i,"DispForm.aspx");
}

function mustCheckOut(){
	dffs_beforeunload = false;	
	if(confirm("You must check out this item to proceed.\n\nCheck out this item now?")){
		var res = spjs_updateItem({"listName":_spPageContextInfo.pageListId,"id":GetUrlKeyValue("ID"),"data":{"CheckedOut":"1"}});
		if(res.success){
			location.href = location.href;
		}else{
			alert(res.errorText);
		}
	}else{
		goToDispForm();
	}
}

function promptCheckin(){
	dffs_beforeunload = false;	
	if(getFieldValue("CheckedOut") === true){
		if(confirm("Do you want to check in this item to allow otheres to contribute?")){
			setFieldValue("CheckedOut",false);
		}
	}
}

$(window).bind("beforeunload",function(event) {
	if(dffs_beforeunload){
		var res = spjs_updateItem({"listName":_spPageContextInfo.pageListId,"id":GetUrlKeyValue("ID"),"data":{"CheckedOut":"0"}});
		if(res.success){
			alert("The list item was checked in.");
		}else{
			alert(res.errorText);
		}
	}
});



Please use the forum for any discussions

Alexander


DFFS: Multiple variations on one form

$
0
0

If you have a very complicated form with a lot of rules and complexity, you might want to split this up in different configurations. Here is an example of how you can do this.

Please note that for example vLookup currently does not “respect” this split in form configurations, and it will load all vLookups regardless of which DFFS form configuration you load. I’m working on a solution to target vLookup to for example separate tabs, but this is not yet ready.
How to enable this form switch

This example will create separate configurations for the form based on a “status” column named “CaseStatus”. To start using this switch, all you have to do is to add these lines of code to the CEWP – above the script tag that refers DFFS_Frontend_min.js.

<script type="text/javascript">
// Override pageId to load different DFFS configurations for different statuses in the "CaseStatus" field.
var dffs_formTypeSwitch = "CaseStatus";
</script>

Please note that you must update DFFS_frontend to v4.272 or later to support this option.

How does it work?

What this code does is to get the current value from the “CaseStatus” field, and appending it to the pageId it uses to query the DFFS configuration list for the correct configuration to load.

How to configure the different forms

To be able to configure the forms for the different “Statuses” you can either enter DFFS backend from a form loaded with the correct status, or edit the URL in DFFS backend directly to change for example “formType=Not started” to “formType=In progress” in the URL example below:

https://contoso.com/DFFS/WebPartPages/DFFS_Backend.aspx?targetList={46e7516d-a6f3-400e-992f-e08338da2ccc}&targetListBaseUrl=/DFFS&formId=/lists/dffs dev/editform.aspx?formType=Not started&formType=3&Source=/DFFS/Lists/DFFSDEV/EditForm.aspx?ID=4

I hope this makes sense. If it does not, please post any questions or comments in the forum.

Alexander

Approve or reject list items

$
0
0

I have previously posted a JavaScript solution for approving multiple documents or list items. This is an updated version that adds two buttons in the ribbon: one for “Approve” and one for “Reject”. Refer the original solution for details, but please note that the variables for controlling the text values have changed.

Use this code to load the solution in a list view
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript" src="/Scripts/ApproveOrRejectSelected.js"></script>
Change the default text values

If you are happy with the default, English text, you can skip this next step.

To override the default text, add this to the CEWP below the script reference to “ApproveOrRejectSelected.js”,and change the text as you like:

<script type="text/javascript">
spjs.contentApproval.text = {
	"approveBtn":"Approve selected",
	"rejectBtn":"Reject selected",
	"groupLabel":"Approve or Reject",
	"working":"Processing items...",
	"done":"{0} items processed"
};
</script>

You can wrap it like this to switch based on the logged in users language (in MUI environments):

switch(_spPageContextInfo.currentLanguage){
	case 1044:
		// Add Norwegian values
		spjs.contentApproval.text = {
			"approveBtn":"Approve selected",
			"rejectBtn":"Reject selected",
			"groupLabel":"Approve or Reject",
			"working":"Processing items...",
			"done":"{0} items processed"
		};
	break;
	case 1031:
		// Add German values
		spjs.contentApproval.text = {
			"approveBtn":"Approve selected",
			"rejectBtn":"Reject selected",
			"groupLabel":"Approve or Reject",
			"working":"Processing items...",
			"done":"{0} items processed"
		};
	break;
}
Download ApproveOrRejectSelected.js

Get the file here.

Alexander

DFFS: New triggers and major improvements in handling linked rules

$
0
0

This post describes changes made in Dynamic Forms For SharePoint (DFFS): http://spjsblog.com/dffs/

I have updated DFFS and introduced some new triggers and improved the functionality related to linked rules.

You can now use a custom function as a rule trigger, and you can also set up rules that can only be triggered by other rules (trough “Run these functions / trigger these rules”), or by a custom function.

Trigger rules manually

You can manually trigger all rules from a custom function like this:

spjs.dffs.triggerRule(["IndexOrFriendlyNameOfRule"]);

Supply the rule identifiers as a comma separated array. Please note that the rule will be executed as if the trigger returned true.

The enhanced “And these rules or functions = true” functionality

On load
Rules with lower index than the current rule, and custom fuctions will be evaluated. Reorder rules if necessary.

On change
The “last run status” of the rules will be checked, and custom functions will be reevaluated.

Checking a custom function
To check the result of a custom function, use the name of the function without parentheses. You can combine a custom function with indexes or friendly name of other rules.

Checking multiple rules
Separate indexes or friendly name with comma to use [and]. Separate indexes or friendly name with pipe to use [or].

Example
Rule1,Rule2,Rule3|Rule4

In this example, Rule1 and Rule2 must be true, and Rule3 or Rule4 must also be true for the overall result to return true.

See change log for details: http://spjsblog.com/dffs/dffs-change-log/

Comments or feedback

Use the forum for discussions related to DFFS: http://spjsblog.com/forums/forum/dynamic-forms-for-sharepoint/

Alexander

DFFS: Contribute your best DFFS forms

$
0
0

I get a lot of questions related to DFFS examples and tips about how create a good DFFS form. Unfortunately I have yet to find time to make these examples myself – not to mention posting YouTube videos on setup and configuration of DFFS.

What I’m asking for here, is that you take a few screenshots of your “best” DFFS form, and write two sentences about how you use it, and post it to the forum here: http://spjsblog.com/forums/topic/dffs-form-examples/

I’ll make this a sticky post in the forum.

PS: If you do not have a forum user, please request one by following these instructions.

Thanks in advance,
Alexander

Comment box with blog: Show comment count

$
0
0

I have updated the solution to be able to count the number of comments on a blog post. This modification is tested in SP2013 only. Parts of it may work for SP2010 as well, but this can not be guaranteed.

Follow the instructions in this post for the basic setup, and then follow these instructions to add the comment count.

Make the SPJS-CommentBox list visible

You must make the list “SPJS-CommentBox” visible to be able to add a lookup column from “Posts” to this list. Either use SharePoint designer (right click the list, select “Properties”, and uncheck “Hide from browser”), or use this tool: http://spjsblog.com/2014/03/26/edit-sharepoint-field-properties-in-sp2010-and-sp2013/

Add lookup field in the SPJS-CommentBox list

Add a lookup column named “ParentPostTitle” from “SPJS-CommentBox” to “Posts” like this:
IMG

Add lookup field in the Posts list

Add a lookup back to “SPJS-CommentBox” called “cBoxCount” like this – note the field “ParentPostTitle (Count Related):
IMG

Update the file “spjs-cBox_min.js” to v2.2.2 or later

Download the latest version here

Then update your function call like this:

var argObj = {
	"placeholderID":"cBox_A",
	"threadID":threadID,
	"blogMode":true, 
	"storeCommentsOnRootSite":false,
	...
	...
	...

Note the setting “blogMode”:true”.

In the “Post” page you add the cBox code like this

IMG

In the Posts list you will see the count of comments like this

IMG

Please post any questions or comments in the forum: http://spjsblog.com/forums/forum/comment-box-for-sharepoint/

DFFS: JSLink version for SP2013

$
0
0

Finally, I have been able to put together a JSLink version of DFFS and all the plugins. This means you no longer need to manually edit any script files, just upload the filed to a document library, add a web part and use the GUI to set up all the DFFS resources.

This solution is still 100% client side, and you don’t need to involve your server administrator to set it up.
How to install

IMG
Refer the installation manual for the details, but basically, this is the steps:

  1. Create a document library
  2. Upload the files
  3. Add a web part
  4. Configure the solution in the GUI
  5. Done!
Under the hood

This solution works by adding a field to the list where you want to use DFFS. This field can either be added as a site column in the site collection root, or directly to a list where you want to use the solution. The field is automatically created in the setup page.

If you set it up as a site column, the GUI configuration in done once, and all you need is to add the site column to each of the lists where you want to activate DFFS in.

Installation files and manual

You find the installation files and the manual for the JSLink version here.

Important information when upgrading

Please note that if you upgrade from an older version, you need to manually remove all the CEWP used to refer the previous version of DFFS from the forms before you add the new “DFFS_loader” field to the list.

Calendars

Currently calendars does not support JSLink so you need to follow a slightly different method involving adding a CEWP or a script editor web part. This is described in the user manual.

Licensing

This version uses a different method to validate the license for site collection scoped licenses. This is based on a challenge-response, and is explained in the manual. This will prevent the use of a site collection scoped license in multiple site collections.

Company, Corporate or OEM licenses does not require this challenge-response actions.

Users with an existing site collection scoped DFFS v4 license, must send me the name of the original license holder, and the challenge code generated in the setup page to receive a new license code.

Important information on the DFFS-JSLink package

For easier installation, I have packaged all the plugins used with DFFS in the zipped file. This package is updated with the newest plugins each time I update DFFS, but each of the plugins may be updated on its own. If you experience issues, or want to look for updated plugins, you find the latest version for each one here:

Not using SharePoint 2013?

This new method for installing DFFS is only supported in SP2013, but you can use the files from the package in older versions as well. Set up the solution like described in the file How to set up DFFS v4 – v1.3.6.pdf. This means some of the files in the package is not used, and some are not included in the package. Refer the latest “frontend” and “backend” folders for the missing files for setup in SP2007 or SP2010.

Comments and feedback

Use the forum for all questions and comments. If you don’t have a user account, look at the sticky post in the top of the forum for details.

Alexander

JSLink: Add client side rendering to a field

$
0
0
Please note that JSLink / Client side rendering is only available in SharePoint 2013.
Change log
July 26, 2015
Updated the code for the JSLink tool to let you pick the field from the list so you don’t have to know the FieldInternalName. The tool is now in v1.1, but I have not updated the pictures below.

Use this code to set the JSLink property of a field in a list or library. This enables you to override the default rendering of the field in NewForm, DispForm, EditForm and list views. See below for links to example files you can apply to the field.

Get the code

Get the code here, and add it to a script editor web part in a page in the site where you want to use it.

How to add a web part page in SP2013

Go to “All site contents” and change the URL like this:

.../_layouts/15/spcf.aspx
Configure the JSLink on the field

IMG

Connect to a list to change the JSLink property:
IMG

JSLink examples
Please note that the JSLink override script files must be placed in a document library in the same site as you plan to use it. When you link to the field, use the “~site” prefix to refer the current site.
Translate choice column

This example let you translate a choice column in NewForm, DispForm, EditForm and list view. Modify the function “spjs_JSLinkLocalize” in the top of the file, and the column name “Status” in the bottom of the file to match your field name (FieldInternalName).

July 26, 2015:
Code example updated with a fix for NewForm and EditForm when used in a root site.
/*
	SPJS JSLink example: Translate choice column in NewForm, DispForm, EditForm and list view.
	--------------------------
	Author: Alexander Bautz / SPJSBlog.com
*/

/* Change the "spjsJSLinkTranslations" object to match your choices */
function spjs_JSLinkLocalize(){
	switch(_spPageContextInfo.currentLanguage){
		case 1044:
			spjsJSLinkTranslations = {
				"New":"Ny",
				"In progress":"Pågår",
				"Closed":"Lukket"
			};
		break;
		case 1031:
			spjsJSLinkTranslations = {
				"New":"Neu",
				"In progress":"In Bearbeitung",
				"Closed":"Geschlossen"
			};
		break;
	}
}

function spjs_JSLinkFieldOverride(t,ctx){
	var a = SPClientTemplates.Utility.GetFormContextForCurrentField(ctx), b, c, h, s, img = (_spPageContextInfo.webServerRelativeUrl !== "/" ? _spPageContextInfo.webServerRelativeUrl : "")+"/_layouts/15/images/loadingcirclests16.gif";
	switch(t){
		case "preRender":
			if(typeof spjsJSLinkData === "undefined"){
				spjsJSLinkTranslations = {};
				spjsJSLinkData = {
					"ticker":0
				};
				if(typeof $ === "undefined"){
					spjs_jQueryLoading = true;
					h = document.getElementsByTagName('head')[0];
					s = document.createElement('script');
					s.src = "https://code.jquery.com/jquery-1.11.3.min.js";
					h.appendChild(s);
				}
				spjs_JSLinkLocalize();
			}
		break;
		case "postRender":
			// Nothing here at the moment
		break;
		case "newform":
		case "editform":
			if(a.fieldSchema.FieldType === "Choice"){
				c = a.fieldSchema.FormatType;
				b = "<span class='spjs_JSLinkHiddenField' style='display:none'>"+SPFieldChoice_Edit(ctx)+"</span><img src='"+img+"' onload='spjs_JSLinkTranslate(this,"+c+");' />";
			}else if(a.fieldSchema.FieldType === "MultiChoice"){
				c = 2;
				b = "<span class='spjs_JSLinkHiddenField' style='display:none'>"+SPFieldMultiChoice_Edit(ctx)+"</span><img src='"+img+"' onload='spjs_JSLinkTranslate(this,"+c+");' />";
			}
		break;
		case "dispform":
		case "view":
			if(spjsJSLinkTranslations[ctx.CurrentItem[ctx.CurrentFieldSchema.Name]] !== undefined){
				b = spjsJSLinkTranslations[ctx.CurrentItem[ctx.CurrentFieldSchema.Name]];
			}else{
				b = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
			}
		break;
	}
	return b;
}

function spjs_JSLinkTranslate(elm,type){
	if(typeof $ === "undefined"){
		if(spjsJSLinkData.ticker > 50){
			alert("Failed to load jQuery");
		}else{
			setTimeout(function(){
				spjs_JSLinkTranslate(elm,type);
			},100);
		}
	}else{
		switch(type){
			case 0:
				$(elm).parent().find("option").each(function(i,o){
					if(spjsJSLinkTranslations[$(o).text()] !== undefined){
						$(o).text(spjsJSLinkTranslations[$(o).text()]);
					}
				});
			break;
			case 1:
				$(elm).parent().find("input:radio").each(function(i,o){
					if(spjsJSLinkTranslations[$(o).next().text()] !== undefined){
						$(o).next().text(spjsJSLinkTranslations[$(o).next().text()]);
					}
				});
			break;
			case 2:
				$(elm).parent().find("input:checkbox").each(function(i,o){
					if(spjsJSLinkTranslations[$(o).next().text()] !== undefined){
						$(o).next().text(spjsJSLinkTranslations[$(o).next().text()]);
					}
				});
			break;		
		}		
		$(elm).fadeOut(200,function(){
			$(elm).parent().find(".spjs_JSLinkHiddenField").fadeIn(200);
		});
	}
}

var spjsJSLink = {}; 
spjsJSLink.Templates = {}; 
spjsJSLink.Templates.OnPreRender = function(ctx){return spjs_JSLinkFieldOverride("preRender",ctx);};
spjsJSLink.Templates.OnPostRender = function(ctx){return spjs_JSLinkFieldOverride("postRender",ctx);}; 
spjsJSLink.Templates.Fields = { 
	"Status": {
		"View":function(ctx){return spjs_JSLinkFieldOverride("view",ctx);},
		"NewForm":function(ctx){return spjs_JSLinkFieldOverride("newform",ctx);},
		"DisplayForm":function(ctx){return spjs_JSLinkFieldOverride("dispform",ctx);},
		"EditForm":function(ctx){return spjs_JSLinkFieldOverride("editform",ctx);}
	}
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(spjsJSLink);
Use the forum for discussions

JSLink Forum


SPJS-Utility updated with support for querying large lists

$
0
0

By request I have added support for querying large lists (over 5000 items) using “spjs_QueryItems” or “spjs.utility.queryItems” in SPJS-Utility.js

If you use this for example with the DFFS Plugin “Autocomplete”, and have hit this error:

The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator

You can now update SPJS-Utility.js to fix this problem.

Please note that these functions are undocumented and mostly used internally from the different SPJS functions and solutions. If you are interested in using these functions in your own code, dig into the code to discover how it works, or ask a question in the forum.

Download

You find SPJS-utility.js here.

Alexander

vLookup connection from NewForm

$
0
0

With the latest version of vLookup for SharePoint (for SP2010 and 2013) you can add vLookup connections from NewForm.

This requires a few extra columns added to the parent and child list, and the setup is described in the user manual.

When adding children from NewForm, you must remember to save the parent form. If not, the newly created child items will be orphaned.

Read about the setup in the user manual, and add questions or comments in the forum.

Please note that the latest version or DFFS and vLookup is currently in BETA, and should not be used in a production environment.

Alexander

SPJS-utility.js updated to v1.250 BETA 1

$
0
0

This version splits up “getFieldValue” and “setFieldValue” in separate functions for each of the field types. You still use them as before, but for advanced users you can now override the function for each individual field type.

In this new function layout you can for example override the function “getFieldValue_SPFieldText” to change how “getFieldValue” returns the value for a field of type “Single line of text”:

spjs.utility.getFieldValue_SPFieldText = function(a){
	return spjs.$(spjs.utility.data.fields[a.fin]).find('input').val();
}

This new layout will also let you add support for new file types in “getFieldValue” and “setFieldValue” by adding a function like this for “set”:

spjs.utility.setFieldValue_SPField[*****] = function(a){
	// change [*****] with the field type of your field, and add your custom getFieldValue logic here.
}

and like this for “get”:

spjs.utility.setFieldValue_SPField[*****] = function(a){
	// change [*****] with the field type of your field, and add your custom getFieldValue logic here.
}

Post any questions in the forum.

Keep in mind that this version id BETA and should not be used in a production environment.

DFFS, vLookup and SPJS-utility BETA 2

$
0
0

I have finally finished BETA 2 of the latest update of Dynamic Forms For SharePoint, vLookup for SharePoint and SPJS-utility.js.

DFFS

This update of DFFS started out as a relatively small update to support the new “add children from NewForm” in vLookup, but one thing lead to another. I have now redesigned the entire trigger handling in DFFS, and added a few new features. Here is a few lines describing the changes.

  • Rules can now be ordered as you like – rules related to one trigger does not have to be grouped together anymore.
  • Changed how rule reversing are handled to how it was before v4.301. In v4.301 I changed this to loop trough all rules that should be reversed, and to apply a “summary” of all these reversed rules after all reversals had been looped trough. This was done to try to fix a performance issue in IE8. I have now gone back to handling all rules one by one as part of a major redesign of the trigger handling. Please report any performance issues related to large lists with a lot or rules.
  • Added new trigger on people pickers in SP2013. If I get feedback that this works, I could add support for SP2010 and possibly SP2007 also.
  • Added new option to “Stop and skip to another rule”. This feature adds a kind of branching to the rule handling.
  • Added option to use “not true” in the “And these rules or functions = true / false” option in the trigger.
  • Added option in the Misc tab to “Launch EditForm in dialog” to be able to return to the DispForm after EditForm is submitted.
  • Fixed potential license validation error when using JSLink version with Google Chrome.
  • Added support for checking
  • Changed the order of Tabs and Rules tab in DFFS backend.
  • Changed layout and color scheme in DFFS backend.
  • Various small refinements of the code.
Download files

Please note that the DFFS, vLookup and other plugins are the same for the “CEWP” version and the “JSLink” version. I have however added the files in both “formats” to the download and install page.

vLookup
  • Changed handling of lookup columns when adding children to remove some internal functions in vLookup, and instead use the corresponding spjs-utility function. Please note that you must update to the latest spjs-utility version. This update is also done in vLookup receiver for NewForm.
  • Various small bugfixes and enhancements to both frontend and backend.
SPJS-utility.js
  • Various small changes related to setting lookup columns and other small fixes related to the changes introduced in BETA 1.
Feedback

Please report all issues in the forums. Let me know if you find any bugs – or if you like what you see.

Alexander

Log to a list when a document has been opened

$
0
0
This code used JSLink / Client side rendering and will therefore only work in SharePoint 2013.

What does this solution do?

This code  adds a custom link to open a document in the browser. Before opening the document the code writes the document name to a list to track that the current user has clicked the link.

This is a basic example, and you can use it as a starting point for your custom solution.

Setup

The code

Start by adding this code to a file in the site where you plan to use the code:

/*
JSLink code to log when a Document has been opened.
--------------------------
Author: Alexander Bautz / SPJSBlog.com
*/

var spjs_currDocInfo = {};

function spjs_logLinkClick(ctx){
var a, b = "", c = "";
a = ctx.CurrentItem;
spjs_currDocInfo[a.ID] = a;
c = a.FileLeafRef.substring(a.FileLeafRef.lastIndexOf(".")+1);
b = "<a class="ms-listlink" title="Open document and log to a list that you have opened this document.">"+"<img style="height: 16px; width: 16px; border: 0; vertical-align: top; margin-right: 3px;" src="/_layouts/15/images/ic"+c+".png" alt="" />"+a.FileLeafRef+"</a>";
return b;
}

function openDocAndLog(id){
var cc = new SP.ClientContext.get_current(), list = cc.get_web().get_lists().getByTitle('DocumentsOpenedLog'), nItem = list.addItem(new SP.ListItemCreationInformation());
nItem.set_item('Title', spjs_currDocInfo[id].FileLeafRef);
nItem.update();
cc.load(nItem);
cc.executeQueryAsync(
function(sender, args) {
SP.UI.ModalDialog.commonModalDialogOpen(_spPageContextInfo.webAbsoluteUrl+"/_layouts/15/WopiFrame.aspx?sourcedoc="+spjs_currDocInfo[id].UniqueId+"&action=interactivepreview",{"allowMaximize":true,"showMaximized":true,"showClose":true});
},
function(sender, args) {
alert('Error: ' + args.get_message());
}
);
}

var spjsOpenDocument = {};
spjsOpenDocument.Templates = {};
spjsOpenDocument.Templates.Fields = {
"SPJS_DocLink": {
"View":function(ctx){return spjs_logLinkClick(ctx);}
}
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(spjsOpenDocument);

Add field to document library

Then you must add a new field to the document library named “SPJS_DocLink”. This is a calculated column with a blank formula:

=""

When the column has been created, you can rename it to for example “Open document with tracking”.

Add the field to the list view, and remove the “Name” column to prevent the users from opening the document with another method

Add JSLink scrip to the field

Use the Field JSLink too for SharePoint 2013 tool for setting the link to the JSlink file in the current field.

The path to use is the site relative path to the file you stored the above code example in. Use this format:

~site/DocLib/FileName.js

Add the list for logging the opening of documents

You must add a list to store log of the opened documents. This list must be placed in the same site as your document library.

The list must be named “DocumentsOpenedLog” as this is the name used in the code example. If you decide to change the display name of this list, you need to modify the code to use the new name.

In this example, the only field used in the “DocumentsOpenedLog” list is the Title. Therefore it is not necessary to add any more fields to this list.

Test the link

Go to your list view and click the link in the new field. The document should open in a dialog, and the “DocumentsOpenedLog” should show a new record with the document name in the “Title” field, and the name of the current user in the “Created by” field.

Discuss this code example in the forum

Alexander

DFFS and vLookup BETA 3

$
0
0
The documentation is not updated with the BETA 3 changes. This will follow as soon as I can manage.
You find the updated files here

I have finally finished the hopefully last BETA of DFFS and vLookup.

The DFFS BETA 3 is compatible with SharePoint 2007, 2010 and 2013, but the BETA 3 of vLookup is for SP2010 and 2013 only. I have not updated vLookup for SP 2007.

Normally, BETA 3 would contain only bugfixes from BETA 2, but I ended up adding a few new features also – like “print” and “email”, a visually brushed-up DFFS backend, and a bit more.

Use the “help icons” in DFFS backend to learn about the new features. See “Documentation” below for more info.

License code handling

The license code has now moved into the DFFS backend configuration (not for the JSLink version).

I have also updated the license code validation to make all versions use the same “format” on the license code.

This mean all but the JSLink version license codes must be updated.

If you have a valid DFFS v4 license you can send me the old license code, and I’ll send you a new one – free of charge.

Please note

I cannot guarantee full backwards compatibility for all older configurations. Please BACK UP your configuration first by going to the Misc tab and Export the configuration to a text file.

This way you can restore your previous version if something did not perform as expected.

Documentation

I have put in a HUGE amount of work in this new version, and as is is long overdue my original release date, I was keen to get it published as soon as I possibly could.

This means I have not been able to update all the documentation for the new version.  This will follow – hopefully tomorrow, but here is a few short notes.

Installation of “CEWP” version

(all but the JSLink verson of SharePoint 2013.)

I have now added a folder “CEWP” to the download package. This contains updated versions of the “DFFS_frontend_CEWP.html”, “DFFS_frontend_overlay.html” and “DFFS_backend_CEWP.html”.

The recommended location for all the DFFS files is in a document library named “SPJS” in the root of each site (or in the root of the site collection).

When the solution is out of BETA

You must update your existing CEWP code to use the latest DFFS and plugins from this package. Ideally, you should change all existing CEWP’s in all your forms to point to the new files. This will make future updates easier to manage as all files has it’s designated location.

Special focus points for testing

The one point I’m most keen to get reports on, is large lists with a lot of rules. I have changed the trigger handling part of the code, and hope it has become more efficient. If you find your form using a long time to load, please consider reworking the rules, and utilize the new functionality to “Stop if this rule = true, and jump to” functionality on the triggers.

You can also control the “reversing” for each individual rule to prevent unnecessary processing of “reversed rules”.

Questions and feedback

Use the forum for all issues with general interest. If you don’t already have an user account, you find instructions in the sticky post in the top of the forum.

Best regards,
Alexander

 

 

Dynamic forms for SharePoint v4.350 is out!

$
0
0

Production release is out!

I have finally finished the production release of DFFS v4.350 and vLookup v2.250 after a long BETA test period. I have not had all that much feedback on the latest BETA, and this can either mean there were no bugs, or that not so many have tested it.

I hope it is the first!

What is new?

The change log will be updated as soon as I can manage, but here is a few vital changes.

The installation process for all but the JSLink version for SP2013 has changed since the last production release. You find information in the updated installation manual. The user manual has also been updated with most of the new features, but I still have some parts left.

If you find a feature you cannot figure out, please look in the forum to see if the question has already been answered. If you cannot find it there, please post a new topic in the forum.

If you don’t have a user account, you find information in the top of each forum.

New license handling

All existing license codes (except the JSLink version) must be updated to a new format to support this new release.

This means you must send me an email to request an updated license.

Site collection scoped licenses

All site collection scoped licenses requires a “Challenge-Response” routine to generate the license key.

Please note that a site collection scoped license can only be used with one site collection. If you need more, you must upgrade your license. Read more here.

JSLink setup option

You find the “Challenge code” generation in the “Setup” page you created in the SPJS library.

CEWP setup option

You find a “License” tab in the backend or DFFS. The license added here will affect all DFFS instances in the current site.

Important information

I try to maintain backwards compatibility with older versions, but I cannot guarantee that all old configurations will upgrade without issues.

Back up you configuration before upgrading

Please BACK UP your configuration first by going to the Misc tab and Export the configuration to a text file.

This way you can restore your previous version if something did not perform as expected.

Plugins

All the plugins used with DFFS is included in this package

Download

Get the package here

Installation

See installation manual and user manual.

Best regards,
Alexander

 

 

 


License agreement for Site collection scoped licenses has been updated

$
0
0

Based on feedback from “corporate users” I have decided to remove the “100 user limit” for the Site collection scoped license.

This means that the “Site collection license” and the “Corporate user license” can now be used in site collections with more than 100 users without violating the license terms.

Read more about the updated license terms here.

Best regards,
Alexander

nSPTiles: Windows style tiles for SharePoint by Anchal Nigam

$
0
0

Some time ago Anchal Nigam asked if it was OK to make a spin-off based on my SharePoint 2013 style tiles solution.

This was no problem to say yes to as my tiles solution has fallen a bit behind on the updates due to other projects – mostly DFFS.

I have now finally fond the time to try out his solution, and it is great!

There is a lot more configuration options than in my original version, and best of all: it has a GUI to create or edit the tiles directly in a grid on the page.

Check it out here: http://nsptiles.js.org/

nSPTilesImage borrowed from the Wikipedia article on Bart Simpson

Please note

This is not a sponsored review. I have written this as a courtesy to Anchal.  I have nothing to do with this solution, and therefore all related questions must be posted in the page linked above.

Alexander

 

Changed outgoing mailserver on SPJSBlog.com

$
0
0

Hi,
I have had some trouble with messages disappearing – especially when someone answers a post in the forum. I have therefore change the outgoing email settings to use Postman SMTP plugin.

This means outgoing email will now be sent from my email address [@gmail.com] and not from [@spjsblog.com].

I’l monitor the email setup to ensure it works as expected, but please post any comments below.

Alexander

Redirect from NewForm to EditForm in DFFS

$
0
0

Here is an alternative solution for redirecting from NewForm to EditForm when using DFFS.

This solution is based on entering NewForm, filling in the Title field, and hitting “Save” to continue in EditForm.

Here is an example on a NewForm

SaveAndContinue

Add this code to the Custom JS

function saveAndRedir(){
var ok = spjs.dffs.check_Mandatory(["Title"]), data = {}, newItem;
if(ok){
data.Title = getFieldValue("Title");
newItem = spjs.utility.addItem({"listName":_spPageContextInfo.pageListId,"data":data});
if(newItem.success){
location.href = location.pathname.substring(0,location.pathname.lastIndexOf("/")) + "/EditForm.aspx?ID="+newItem.id;
}else{
alert(newItem.errorText);
}
}
}

function PreSaveAction(){
saveAndRedir();
}

This is it – test it and let me know how it works out  in the Forum.

Best regards,
Alexander

DFFS installation guide for JSLink version is on YouTube

$
0
0

Hi,
I have finally made an installation guide for the JSLink version on YouTube – you find it here

I’ll add more guides as soon as I find time, but If you need a specific guide you can request it in the comments below, and I’ll see what I can do.

Alexander

Viewing all 391 articles
Browse latest View live