Category Archives: DFFS Plugin

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

Cascading dropdowns now supports multi choice

I have updated the cascading dropdown solution to support multi choice in all positions. Refer this article for setup instructions and background information.

To use multichoice on the select, you must use a multiline plain text field as “placeholder”, and address the field like the field “ThisListField2” in the “spjs.casc.init” function:

spjs.casc.init({
	lookupList:"NameOfYourList",
	lookupListBaseUrl:"BaseUrlOfYourList",
	lookupListFields:["LookupListField1","LookupListField2"],
	thisListFields:["ThisListField1","ThisListField2:multi"],
Edit form

IMG

Display form

IMG

List view

IMG

If you plan to use this with DFFS you must update to DFFS backend v4.259 to support the “:multi” suffix in the cascading dropdown configuration.

Post any questions in the forum

If you do not already have a forum user, look at the sticky post Register for a user account.

Alexander

Cascading dropdowns updated to v3.30

I have posted a small update to SPJS-Casc.js to fix these issues:

  • Added support for autofilling values when using “Autofill subsequent dropdowns when they contain only one valid option.” in DFFS.
  • Changed the jQuery variable from $ to spjs.$ to fix a bug with SharePoints internal file “assetpicker.js” as this one kills jQuery.

Get the updated version here

You find the article describing the solution here, and you find the dedicated forum here.

Alexander

SPJS-Lookup: Convert a single line textfield to a dropdown select based on a query

Change log

You find the latest change log here: https://spjsblog.com/dffs/dffs-change-log/

v1.11 (August 17, 2015):
Fixed an error resulting in existing values not validating when loadign an item in EditForm.

v1.10 (February 28, 2015):
If you want to have the same list of choices in multiple fields, you can now populate an unlimited number of fields from one single query. All you have to do is to use an array of fields in the parameter “fieldToConvertToDropdown”. See code example below for details.

v1.05 (February 12, 2015):
Added option to specify a folder in the query. The custom CAML or query will search only in the specified folder. Please note that you must update spjs-utility.js to v1.205 or later.

v1.04:
Removed a border around an image that occurred in SP 2010.

v1.03:
Fix for “addToExternalList” when using the solution for multiple fields in a form, and more than one targetted the same lookup list. The callback would refresh the bottom SPJS-Lookup field as the “argument object” was not uniquely identified.

January 21, 2015
v1.02:
Fixed a bug where I had mistakenly used the display name and not the FieldInternalName as identifier for the fields.

This is a remake of a solution I posted in 2009. It does mostly the same as the old one, but the code is overhauled, and it is now compatible with DFFS.

What does it do?

This solution is used to convert a single line of text field into a dropdown select. The options for this select is the result of a query you build in the function call. You can use it to query any list within the same site collection. You have an option to add new values to the “lookup list” on the fly, or to enter a value free hand.

This solution is compatible with SP2007, SP 2010 and SP2013.

DFFS plugin

This is compatible with DFFS, but you will not find a dedicated “tab” in DFFS to set it up. You must therefore use the same code for both DFFS and standalone use. With DFFS you have the option to put the function call in the Custom JS section in the Misc tab.

The code

If you use it as a standalone solution, you must refer jQuery and SPJS-utility.js in addition to SPJS-lookup.js.

In a standalone setup it will look something like this
<script type="text/javascript" src="/code/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="/code/spjs-utility.js"></script>
<script type="text/javascript" src="/code/spjs-lookup.js"></script>
<script type="text/javascript">
// Put the contents from the code block below here.
</script>

If you use it with DFFS, the only extra script you need is this (in the DFFS_frontend CEWP) – put it below the reference to spjs-utility.js:

<script type="text/javascript" src="/code/spjs-lookup.js"></script>
The function call
spjs.lookup.init({
	"fieldToConvertToDropdown":["MyTextField"],	
	"listName":"Tasks",
	"listBaseUrl":"/Sites/MySite",
	"optTextFieldInternalName":"Title",
	"sortFieldName":"Title",
	"filterObj":{
		"on":true,
		"folder":"", // Leave empty to search in all folders
		"CAML":null, // If used, the rest of the filterObj settings are disregarded
		"fin":"Completed",
		"isLookup":false,
		"operator":"Neq",
		"filterVal":"1"
	},
	"dropDownDefaultvalue":"...",
	"addYouOwnValue":{
		"on":true,
		"linkText":"Write your own value"
	},
	"addToExternalList":{
		"on":false,
		"customFunction":null, // Function name as a string. If a function name is supplied, this will be used in stead of the default function. The function will be passed the argument object as a parameter.
		"linkText":"Add new item",
		"saveNewItemText":"Save new item"
	},
	"debug":false
});
Parameter details
  • fieldToConvertToDropdown: This is an array or FieldInternalNames of the fields in the current list that you want to convert to a dropdown. Specify multiple fields like this: [“FirstField”,”SecondField”] to have all server the same options based on one single query.
  • listName: This is the display name or the list GUID of the list you read the options from.
  • listBaseUrl: This is the base URL of the list you read the options from. If the list is on the root site of your domain, the value will be an empty string like this “”. If it is on a managed path, it will be something like this: “/Sites/MySite”
  • optTextFieldInternalName: This is the FieldInternalName of the field that represents the options you want to show in the dropdown select.
  • sortFieldName: This is the FieldInternalName of the field you want to sort the options by. Most likely the same as “optTextFieldInternalName”.
  • filterObj
    • on: true or false to tell if the options should be filtered. If false, all options will be shown.
    • folder: Here you can provide a relative URL to a folder like this: /Sites/MySite/Lists/MyList/MyFolder/MySubFolder
    • CAML: Here you can provide the full CAML query to filter by. If this is left as null, the other options below will take effect.
    • fin: The FieldInternal name you want to filter on.
    • isLookup: true or false. If you filter by a text value, use false. If you filter by an ID in a lookup field, set it as true.
    • operator: Use anu valid CAML operator like “Eq”, “Neq”, “BeginsWith” or “Contains”.
    • filterVal: This is the value you want to filter by.
  • dropDownDefaultvalue: This is the default value in the dropdown when it has not been selected.
  • addYouOwnValue
    • on: true or false. This controls whether or not to show a link to “kill” the dropdown and show the underlaying text field.
    • linkText: This is text on the link.
  • addToExternalList
    • on: true or false. This controls whether or not to show a link to add an item to the list you are pulling the options from.
    • customFunction: If you want to override the built “addToExternalList” function, add your custom function name here like this: “myAddListItemFunc”. The function itself must be present in the page, and it will get the full “argObj” passed to it as a parameter.
    • linkText: The link text that initiates the “addToExternalList” function.
    • saveNewItemText: The text on the “save” link.
  • debug: true or false. If true, the underlaying text field will not be hidden, and you will see a yellow information panel in the top of the page.
Setting a value in a field with this solution activated

To set the value of a field when using this solution, use code like this:

spjs.lookup.setValue("FieldInternalName_of_your_field","The value you want to set");

This will also work with DFFS and will trigger any rule currently configured for the underlaying text field (by triggering the blur-event).

Questions or feedback

Please use the forum for all questions related to this solution.

Alexander

vLookup for SharePoint 2010-13 v2.100 BETA

I have published a BETA version of vLookup Frontend with these changes:

  • Fixed a bug where number columns could not use the “css” set in vLookup setup.
  • Changed how the list name is picked up from the URL as this would fail in some cases – as described here.
  • Added support for settings SPFieldLookupMulti fields when creating children – as requested here.
  • Changed the $ to spjs.$ as I did in the latest BETA of DFFS due to an error in SharePoint when using rich text fields and “Insert > Link > From SharePoint” as the file “assetpicker.js” will “kill” jQuery by overriding the global $ variable.

Get the latest BETA version here (ensure you pick the latest one).

This is released as a BETA due to the changes in how jQuery is referred. Please post any findings or questions in the forum.

Best regards,
Alexander