All posts by Alexander Bautz

Changed outgoing mailserver on SPJSBlog.com

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

nSPTiles: Windows style tiles for SharePoint by Anchal Nigam

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

 

License agreement for Site collection scoped licenses has been updated

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

Dynamic forms for SharePoint v4.350 is out!

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

 

 

 

DFFS and vLookup BETA 3

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

 

 

Log to a list when a document has been opened

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, vLookup and SPJS-utility BETA 2

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

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

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.