Category Archives: DFFS

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

 

 

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 updated with support for querying large lists

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

DFFS: JSLink version for SP2013

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.

Change log
July 31, 2015
Added a new button in the Site column setup section to handle some cases where the DFFS_Loader columns became orphaned and lost the connection to the site column. This new button does not reattach them to the site column, but iterates over the columns found in the site collection, and updates all columns with the new configuration.
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

DFFS: Contribute your best DFFS forms

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: https://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

DFFS: New triggers and major improvements in handling linked rules

This post describes changes made in Dynamic Forms For SharePoint (DFFS): https://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: https://spjsblog.com/dffs/dffs-change-log/

Comments or feedback

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

Alexander

DFFS: Multiple variations on one form

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.

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

DFFS: Check out list items

Change log
December 14, 2015
Added a fix for an unintentional check-in when adding attachments on SP2007 with Internet Explorer 8/9. See code section below.

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

Please note a typo in “promptCheckin” – use lover case “i” to correspond with the function in the Custom JS below.

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);
		}
	}
});

// Fix for add attachment in IE 8 / 9 on SharePoint 2007
$("a[href^='javascript:UploadAttachment()']").hover( 
	function(){
		dffs_beforeunload = false;
	},
	function(){
		dffs_beforeunload = true;
	}	
);

Please use the forum for any discussions

Alexander