Category Archives: Requests

Break permission inheritance on a new list item and assign edit rights to users selected in a people picker

I got a request for a solution to break inheritance of permissions on a new list item and assign edit rights to users selected in a people picker.

IMPORTANT INFORMATION:

Unfortunately users must have Manage Permissions rights to be able to use this code. You must assign this right to the users by going to Site settings > Site permissions > Permission levels > Edit permission level > Site permissions > Manage permissions. Do this with caution as it will give general Mange permission rights if you don’t add a custom permission level and assign it to a specific SharePoint user group.

This example requires a list with a multichoice people picker where you select the users to assign edit item permissions – the name of this people picker is in this code is EditRightsPeoplePicker, but you can specify the name in the bottom of the code snippet.

Add the below snippet to the Custom JS textarea of your DFFS Enabled NewForm. When saving the item the default save function will be cancelled and the custom function will create an item, break permission inheritance and assign edit rights to the users selected in the people picker. In addition, the current user will get full control over the list item.

Please note that this is not a complete fully functional solution – it is only a proof of concept and you can use it as a starting point for making your own solution.

// Don't edit this function
 function breakroleinheritance(arg) {
     var deferred = jQuery.Deferred();
     jQuery.ajax({
         "url": arg.listBaseUrl + "/_api/web/lists/getbyid('" + arg.listGuid + "')/items(" + arg.itemId + ")/breakroleinheritance(false)",
         "type": 'POST',
         "headers": {
             'X-RequestDigest': jQuery('#__REQUESTDIGEST').val(),
             "accept": "application/json;odata=verbose",
             "content-type": "application/json;odata=verbose"
         },
         "success": function(data) {
             deferred.resolve(true);
         },
         "error": function(err) {
             console.log(err);
             deferred.reject(err);
         }
     });
     return deferred.promise();
 }
 // Don't edit this function
 function doAssignNewRole(arg) {
     var deferred = jQuery.Deferred(),
         ticker = 1;
     jQuery.each(arg.roles, function(i, r) {
         jQuery.ajax({
             "url": arg.listBaseUrl + "/_api/web/lists/getbyid('" + arg.listGuid + "')/items(" + arg.itemId + ")/roleassignments/addroleassignment(principalid=" + r.principalid + ",roledefid=" + r.roledefid + ")",
             "type": 'POST',
             "headers": {
                 'X-RequestDigest': jQuery('#__REQUESTDIGEST').val()
             },
             "success": function(data) {
                 if (ticker === arg.roles.length) {
                     deferred.resolve(true);
                 } else {
                     ticker += 1;
                 }
             },
             "error": function(err) {
                 console.log(err);
                 deferred.reject(err);
             }
         });
     });
     return deferred.promise();
 }
 // Don't edit this function
 function setItemLevelSecurity(arg) {
     var deferred = jQuery.Deferred();
     breakroleinheritance(arg).done(function() {
         doAssignNewRole(arg).done(function(success) {
             deferred.resolve(arg.itemId);
         }).fail(function(err) {
             spjs.dffs.alert({
                 "title": "Add roles error",
                 "msg": JSON.stringify(err)
             });
         });
     });
     return deferred.promise();
 }
 // Don't edit this function
 function init_setItemLevelSecurity(arg) {
     var deferred = jQuery.Deferred();
     var users = spjs.utility.getFieldValue({
         "fin": arg.peoplePicker,
         "key": "loginName"
     });
     var roleArr = [],
         userIdArr = [];
     jQuery.each(users, function(i, login) {
         var userId = spjs.utility.userInfo(login).ID;
         roleArr.push({
             "principalid": userId,
             "roledefid": "1073741830" // 1073741830 = edit
         });
         userIdArr.push(userId);
     });
     // Create new item
     var newItemData = {};
     newItemData.Title = getFieldValue("Title");
     newItemData[arg.peoplePicker] = userIdArr.join(";#;#");
     var res = spjs.utility.addItem({
         "listName": _spPageContextInfo.pageListId,
         "data": newItemData
     });
     arg.roles = roleArr;
     if (res.success) {
         arg.itemId = res.id;
         setItemLevelSecurity(arg).done(function(id) {
             deferred.resolve(id);
         });
     }
     return deferred.promise();
 }
 function dffs_PreSaveAction() {
     createNewItemWithItemLevelSecurity();
     return false;
 }
 // Edit this function
 function createNewItemWithItemLevelSecurity() {
     init_setItemLevelSecurity({
         "listBaseUrl": _spPageContextInfo.webServerRelativeUrl,
         "listGuid": _spPageContextInfo.pageListId,
         "peoplePicker": "EditRightsPeoplePicker"
     }).done(function(itemId) {
         // Done
         location.href = location.href.split("NewForm.aspx")[0] + "EditForm.aspx?ID=" + itemId;
     });
 }

Please post any questions in the comments below.

Alexander

Keep track of assigned and unassigned keys for office locations

I got a request for a solution to solve the following question:

I break down the columns in the two lists below. What I’m trying to accomplish is to get the “key designation” field in the key log list to drive the number of assigned, unassigned and total keys in the inventory. For example, if “assign” is chosen in the key designation field of the key log, it automatically increases the number of keys assigned by one key, while decreasing the number of keys unassigned. If “return” is selected, it automatically decreases the number of assigned keys and increases the number of unassigned keys. The inventory holds information detailing keys across two different locations/offices. The columns in the inventory are:

  • Site (Boston, New York, etc.) 
  • Protected Area (the area to which the keys provide access)
  • Identifier (corresponding symbol on the key that ties that key to the protected area [identifier x = broom closet protected area for example])
  • Number of Keys Assigned (5)
  • Number of Keys Unassigned (4)
  • Total Keys (sum of the number of assigned and unassigned keys [9])

The Key Log tracks when a key is assigned, returned, added or deleted and who assigned the key (with 2 person or group fields to account for dual control). The columns in the log are:

  • Site
  • Protected Area
  • Identifier
  • Key number
  • key designation (if we’re assigning, returning, adding or deleting a key)
  • person or group #1 (to show who assigned the key)
  • person or group #2 (to show dual control for 2nd person assigning the key)

I have created two lists with the essential fields to make the relationship like this:

inventory list

The TotKeys is a calculated column that sums the NumberAssigned and NumberUnassigned.

keylog list

The KeyDesignation field has these choices:

assigning
returning
adding
deleting

Now install DFFS in the keylog list and set up a cascading dropdown like this:

Cascading dropdown config

Then add this in your Custom JS of both NewForm and EditForm in the keylog list:

When adding or editing a keylog item the corresponding item in the inventory will be updated with the correct count.

// Reset KeyDesignation field on load
setFieldValue("KeyDesignation", "");

function dffs_PreSaveAction() {
    var site = getFieldValue("Site");
    var protectedArea = getFieldValue("ProtectedArea");
    var inventoryItem = spjs.utility.queryItems({
        "listName": "inventory",
        "query": "<Where><And><Eq><FieldRef Name='Site' /><Value Type='Text'>" + site + "</Value></Eq><Eq><FieldRef Name='ProtectedArea' /><Value Type='Text'>" + protectedArea + "</Value></Eq></And></Where>",
        "viewFields": ["ID", "NumberAssigned", "NumberUnassigned"]
    });
    var pass = true;
    if (inventoryItem.count > 0) {
        var item = inventoryItem.items[0];
        var assigned = item.NumberAssigned !== null ? parseInt(item.NumberAssigned, 10) : 0;
        var unassigned = item.NumberUnassigned !== null ? parseInt(item.NumberUnassigned, 10) : 0;
        var keyDesignation = getFieldValue("KeyDesignation");
        switch (keyDesignation) {
            case "assigning":
                if (unassigned > 0) {
                    assigned += 1;
                    unassigned -= 1;
                } else {
                    pass = false;
                    spjs.dffs.alert({
                        "title": "No keys available",
                        "msg": "You are trying to assign a key, but no unassigned keys are available.",
                        "ok": function() {
                            // Close dlg
                        }
                    });
                }
                break;
            case "returning":
                if (assigned > 0) {
                    assigned -= 1;
                    unassigned += 1;
                } else {
                    pass = false;
                    spjs.dffs.alert({
                        "title": "No keys assigned",
                        "msg": "You are trying to unassign a key, but no keys are assigned.",
                        "ok": function() {
                            // Close dlg
                        }
                    });
                }
                break;
            case "adding":
                unassigned += 1;
                break;
            case "deleting":
                unassigned -= 1;
                break;
        }
        // Update list item with new count
        spjs.utility.updateItem({
            "listName": "inventory",
            "id": item.ID,
            "data": {
                "NumberAssigned": assigned,
                "NumberUnassigned": unassigned
            }
        });
    }
    if (pass) {
        return true;
    } else {
        return false;
    }
}
keylog list NewForm

Let me know in the comments below if you have any questions.

Alexander

Collect feedback from pages or list items

Change log
February 07. 2015
Updated to v1.3:

  • Fixed a bug introduced in v1.1. When triggering this from a list item, you ended up with two entries for “itemID” in the URL.

February 14. 2014
Updated to v1.2:

  • Added option to store the site title in an additional field in the list. To activate this, add a field with FieldInternalName “SiteTitle” to the list.

January 28. 2014
Updated to v1.1:

  • Include site title in the Title field in the feedback if it is collected from a page and not a list item.
  • Changed from locationl.pathname to the full location.href in the URL for collected feedback.

I got this request:

Dear Alexander,
I’ve been cruising your blog for a week or so and I have to say – THANKS!
The solutions you posted are wonderful and very helpful!

I have a special request that might be useful for many users and I’ll defently buy you a nice cold beer for it !

I need a way to send a feedback from any list item and page in SharePoint. The way I see it is some clickable button in a CEWP inserted in a page and some custom button in the ribbon of a list item.

I’d been asked to allow the users to answer some questions (2-4 pre added) and the ability to add some text of their own.

If there’s a way to have your assistance in that matter I’ll adores you forever and send you a cold beer to chill.

Thanks in advance,
Eron F.

The solution

This solution is for SP 2010 or 2013 only and it will NOT work for SP 2007.

This solution will add a banner button or a regular button (details below) that lets your users add feedback to a custom list in the site collection. The solution will fill the “Title” column with the list item title if it is a list item (DispForm or EditForm) and the URL from where the feedback was added. You can add this code to any page in the site collection using a CEWP.

How to set it up

Start with adding a custom list to the site collection. This list must Include the standard “Title” field (already present), a single line of text column called “URL”, and another single line of text column named “SiteTitle”. These columns are used to log where the feedback was added from. You must add additional columns to this list to collect the actual feedback – like a multi line text field. Which columns you want to add is up to you. The relative URL to this list is used in the argument object described below. This custom list does not require any code added to it.

Not using English language?
You must change the display name for the localized Title field to the English “Title” in the list you want to store the feedback in. This because the script addresses the field by display name.

Download the latest version of SPJS-CollectFeedback from here, and put it in a document library where all users have READ ACCESS.

When this list is set up and the file “SPJS-CollectFeedback.js” is downloaded, you can add the code from the code block below to any page in the site collection using a HTML Form Web Part or CEWP. You might want to change the jQuery reference to a local copy, and you must change the reference to “SPJS-CollectFeedback.js” to point to your local copy.

Use this code to insert a ribbon button
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="/Scripts/Feedback/SPJS-CollectFeedback.js"></script>
<script type="text/javascript">

$(document).ready(function(){
	spjs.collectFeedback.initRibbonBtn({
		"feedbackListNewFormURL":"/CommentBox/Lists/Feedback/NewForm.aspx",
		"feedbackAddedAlert":"Thank you for the feedback!",
		"feedbackNotAddedAlert":"",
		"ribbonBtnText":"Send<br>feedback",
		"ribbonBtnImg":"/_layouts/images/ltann.gif"		
	});
});
</script>
Or use this code to insert a regular button
<input type="button" value="Send feedback" onclick="triggerFeedback();" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="/Scripts/Feedback/SPJS-CollectFeedback.js"></script>
<script type="text/javascript">

function triggerFeedback(){
	spjs.collectFeedback.init({
		"feedbackListNewFormURL":"/CommentBox/Lists/Feedback/NewForm.aspx",
		"feedbackAddedAlert":"Thank you for the feedback!",
		"feedbackNotAddedAlert":""
	});
}
</script>
The various arguments

feedbackListNewFormURL: The relative URL of the list to store the feedback in.
feedbackAddedAlert: If this is not an empty string you will get an alert after adding the feedback.
feedbackNotAddedAlert: If this is not an empty string you will get an alert if you cancel adding the feedback.
ribbonBtnText: The label of the ribbon button.
ribbonBtnImg: The image of the ribbon button (32×32 px).

Post a comment below if you like the solution or you have any questions.

Alexander

Remove click events and disable anchor tags in a SP2010 calendar view

I got a request from Larry Pfaff:

…Can all the links be disabled on a calendar view and allow navigation between months for sp 2010?

A bit back and forth between Larry and me produced this code:

<!-- refer jQuery -->
<script type="text/javascript">
 
$(".ms-acal-rootdiv").bind("click dblclick",function(){
            return false;
});
 
setInterval(function(){           
            $(".ms-acal-item [bricked!='1']").each(function(){    
                        $(this).attr("bricked","1").bind("click dblclick",function(){              
                                    return false;
                        });
            });
            // Single day events
            $(".ms-acal-sdiv a").each(function(){
                        var text = $(this).text();
                        $(this).before(text);
                        $(this).remove();
                       
            });
            // Events spanning multiple days
            $(".ms-acal-mdiv a").each(function(){
                        var text = $(this).text();
                        $(this).before(text);
                        $(this).remove();
                       
            });
 
},500);
</script>

Put it in a HTML Form web part – or link it from a CEWP placed below the calendar view.

This code is tested in SP 2010 only.

Alexander

Translate SharePoint form field label and description by a dropdown select

Change log
August 08. 2013
Moved the code for the file “TranslateFormFields.js” to spjsfiles.com due to errors in the preview.

I got this request from Mary Larson for a solution to translating a SharePoint 2010 form in 20+ languages by the selection of a desired language in a dropdown select.

I guess installing all these languages as language packs and using the MUI interface to translate the form is not an option.

I created this solution for translating the form label and description (description not supported in DispForm) – with cookie support for remembering the selected language.
IMG

Get the code for the file TranslateFormFields.js here.

You can either include this code in the HTML Form Web part or you can put it in a folder as a separate file and refer it using a script tag.

When the above code is referred, call the translation script like this from a HTML form Web part placed below the form web part:

<script type="text/javascript" src="/Scripts/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="/Scripts/TranslateFormFields.js"></script>
<script type="text/javascript">

/*
	The translation setup:
	dropdownLabel: "text" is the displayed text, "style" is the CSS style you want to apply to the label.
	dropdownDefaultVal: This is the initial value you want to display in the dropdown.
	lcArr: This is the array of languages as they should appear in the dropdown select.
	translations: This is an object literal in this format:	
		FieldInternalName_of_field : [
						{
							"label":"Tittel",
							"description":"This is the norwegian title"
						},
						{
							"label":"Titel",
							"description":"This is the swedish title"
						}
					]
*/

spjs.translateForm.init(
	{
		"dropdownLabel":
			{
				"text":"Translate",
				"style":"font-weight:bold"
			},
		"dropdownDefaultVal":
			"English",
		"lcArr":
			[
				"Norwegian",
				"Swedish"
			],	
		"translations":
			{
				"Title":
					[
						{ // Norwegian
							"label":"Tittel",
							"description":"This is the norwegian title"
						},
						{ // Swedish
							"label":"Titel",
							"description":"This is the swedish title"
						}
					],
				"Status":
					[
						{ // Norwegian
							"label":"Prosjektstatus",
							"description":"This is the norwegian status"
						},
						{ // Swedish
							"label":"Projektstatus",
							"description":"This is the swedish status"
						}
					]
			}
	}
);
</script>

This code is tested in a out of the box SharePoint 2010 only, but it most likely will work in out of the box forms in SP 2007 and 2013 as well.

Please let me know if you have trouble getting it to work, or you have any success stories.

If you like the solution, please click the beer mug in the top right margin of this page to buy me some beer!

Alexander

Open PDF files in a maximized dialog

I got a request from Brett Anderson regarding a solution for opening PDF files in a maximized dialog window in SharePoint 2010. This code will most likely work in SharePoint 2013, but it has not been tested.

Please note that “Browser file handling” must be set to “Permissive” under “Web application general settings” in SharePoint Central Administration.

This is the code we ended up with after some back and forth:

<!-- Put this code below the list view web part -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$("a[href$='.pdf']").each(function(){
	$(this).removeAttr("onclick").attr("href","javascript:openPDFinDlg(\""+this.href+"\")");	
});

function openPDFinDlg(href){
	var o;
	$("body").append("<div id='pdfTemp' style='min-height:600px;min-width:800px;height:100%;overflow:hidden'><object data='"+href+"' width='100%' height='100%' type='application/pdf' ></object></div>");
	o = {};
	o.html = $("#pdfTemp")[0];
	o.showMaximized = true;
	o.title = href.substring(href.lastIndexOf("/")+1);
	o.dialogReturnValueCallback = openPDFinDlgCallback;	
	SP.UI.ModalDialog.showModalDialog(o);
}

function openPDFinDlgCallback(){
	 // do something here when the dialog closes
}
</script>

Enjoy,
Alexander

SharePoint form: present fields side-by-side: Updated version

I have previously posted a solution for presenting form fields side-by-side.

This is an updated version derived from the DFFS project.

I have made this updated version by request from Steve Eberl because the older version proved incompatible with IE10. Hopefully this new version will be more compatible, but honestly: I have not tested it in IE10, as I have not installed it yet!

I have done some quick tests in SharePoint 2007 and SharePoint 2010. I guess it will work for SharePoint 2013 also, but this has not been confirmed. Please let me know if someone has tested it.

<script type="text/javascript" src="/test/English/Javascript/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="/test/English/Lists/SideBySide/spjs-utility.js"></script>
<script type="text/javascript">

spjs_sideBySide = {
	"data":{"css":false},
	"apply":function(fObj,arr){
		var h, b;
		if(!spjs_sideBySide.data.css){
			var cssArr = [];
			cssArr.push("<style type='text/css'>");
			cssArr.push(".sbs_FieldTable td.ms-formbody{border-top:none;width:auto;}");
			cssArr.push(".sbs_FieldTable td.ms-formlabel{border-top-color:#d8d8d8;width:auto;}");
			cssArr.push(".sbs_FieldTable input.ms-long{width:auto;}");
			cssArr.push("</style>");
			$("body").append(cssArr.join(""));
			spjs_sideBySide.data.css = true;
		}
		$.each(arr,function(i,o){
			if($("#sbs_OuterTR_"+o.index).length===0){
				$(fObj[o.fin]).before("<tr class='sbs_OuterTR' id='sbs_OuterTR_"+o.index+"'><td valign='top' colspan='2'><table class='sbs_OuterTable' style='width:100%' cellpadding='0' cellspacing='0'><tr class='sbs_InnerTR' id='sbs_InnerTR_"+o.index+"'></tr></table></td></tr>");
			}
			h = $(fObj[o.fin]).css("display") === "none";
			b = [];
			b.push("<td FieldDispName='"+$(fObj[o.fin]).attr('FieldDispName')+"' FieldType='"+$(fObj[o.fin]).attr('FieldType')+"' class='sbs_Field' fin='"+o.fin+"' id='sbs_Field_"+o.fin+"' valign='top' style='white-space:nowrap;");			
			if(h){
				b.push("display:none;");				
			}
			b.push("'>");
			b.push("<table class='sbs_FieldTable' style='width:100%' id='sbs_FieldTable_"+o.fin+"' cellpadding='0' cellspacing='0'></table>");
			b.push("</td>");
			$("#sbs_InnerTR_"+o.index).append(b.join(""));
			if(o.labelHidden){
				$(fObj[o.fin]).find("td.ms-formlabel").hide();
				if(o.padHiddenLabel){
					$("#sbs_FieldTable_"+o.fin).append("<tr class='sbs_FieldLabel' id='sbs_FieldLabel_"+o.fin+"'><td class='ms-formlabel'> </td></tr>");
				}
			}else{
				$("#sbs_FieldTable_"+o.fin).append("<tr class='sbs_FieldLabel' id='sbs_FieldLabel_"+o.fin+"'></tr>");
				$(fObj[o.fin]).find("td.ms-formlabel").appendTo($("#sbs_FieldLabel_"+o.fin));
			}
			$(fObj[o.fin]).appendTo($("#sbs_FieldTable_"+o.fin));
			fObj[o.fin] = $("#sbs_Field_"+o.fin)[0];
			if(h){
				$(fObj[o.fin]).find("td.ms-formbody").parent().show();
			}				
		});
	},
	"resize":function(){
		if(GetUrlKeyValue('IsDlg')!=='1'){
			return;
		}
		if(_spPageContextInfo.webUIVersion === 15){
			ExecuteOrDelayUntilScriptLoaded(function(){
				SP.UI.ModalDialog.get_childDialog().autoSize();
			}, "sp.js");
		}else{
			// http://blog.collabware.com/2012/10/30/tips-tricks-sharepoint-2010-modal-dialogs/
			var dlg = SP.UI.ModalDialog.get_childDialog();
			if(dlg != null) {				
				if(!dlg.$S_0 && dlg.get_$Z_0()){
					dlg.autoSize();
					var xPos, yPos, win = SP.UI.Dialog.get_$1(), xScroll = SP.UI.Dialog.$24(win), yScroll = SP.UI.Dialog.$26(win);
					xPos = ((SP.UI.Dialog.$1d(win) - dlg.$2_0.offsetWidth) / 2) + xScroll; 
					if (xPos < xScroll + 10) {
						xPos = xScroll + 10;
					}
					yPos = ((SP.UI.Dialog.$1c(win) - dlg.$2_0.offsetHeight) / 2) + yScroll;
					if (yPos < yScroll + 10) {
						yPos = yScroll + 10;
					}
					dlg.$T_0 = xPos;
					dlg.$U_0 = yPos;
					dlg.$m_0(dlg.$T_0, dlg.$U_0);
					dlg.$H_0.style.width = Math.max(dlg.$6_0.offsetWidth - 64, 0) + 'px';
					dlg.$2B_0();
				}
			}
		}
	}
}

var fields = init_fields_v2();
/*
	index: Use the same index for all fields in the same row.
	fin: FieldInternalName of the field.
	labelHidden: Hide form label.
	padHiddenLabel: If labelHidden = true, set this to true to fill the empty space left from the hidden formlabel.
*/

var arr = [
	{"index":"1","fin":"FirstName","labelHidden":false,"padHiddenLabel":true},
	{"index":"1","fin":"MiddleName","labelHidden":false,"padHiddenLabel":true},
	{"index":"1","fin":"LastName","labelHidden":false,"padHiddenLabel":true},
	{"index":"2","fin":"DropDownChoice","labelHidden":false,"padHiddenLabel":true},
	{"index":"2","fin":"RadioButtonsChoice","labelHidden":false,"padHiddenLabel":true},
	{"index":"2","fin":"CheckboxesChoice","labelHidden":false,"padHiddenLabel":true}
];

spjs_sideBySide.apply(fields,arr)
// For SP 2010
spjs_sideBySide.resize();
</script>

Please let me know whether it is functioning as expected.

Alexander

Dynamic Forms for SharePoint: Now with side-by-side

Change log
May 06. 2013
I have released v2.95 – you find it here
April 28. 2013
Bugfixes in v2.94:

  • Fixed a bug regarding comparing date and time columns where the trigger column is empty.

April 14. 2013
Bugfixes in v2.93:

  • Fixed bug in validating required rich text field when using non English letters.
  • Fixed bug where fields appearing in the “orphan fields tab” when using Side by Side.
  • Prevented the ID column from appearing in the “orphan fields tab”.
  • Fixed bug where people pickers lost their value in EditForm in Chrome (and possibly other non-IE browsers).

There are changes in both “DynamicFormsForSharePoint_v2.js” and “default.css” – ensure you update both.

March 29. 2013
Bugfixes in v2.91:

  • Fixed bug in side-by-side functionality regarding the “fields” not getting the correct fieldtype and fielddispname attributes.
  • Fixed bug where the field label was repeated multiple times when combining side-by-side with readonly, and then switching tab.

I have released version 2.90 of Dynamic Forms for SharePoint with these changes:

  • Added content type choice as possible trigger field.
  • Added side-by-sice capabilities.
  • Fixed a bug where the link to add tabs were missing for the first setup.
  • Changed the function that dynamically resizes the dialog. This new function is created by Sing Chan, and can be found here
  • Added a fix for some occurrences where the variable L_Menu_LCID was missing in a SP2013 setup.
  • Fixed a bug in SP.UI.RTE.js that occurs when hiding rich text columns in SP2010. The workaround is provided by John Chapman.

Refer these articles for background information and setup instructions:
Dynamic Forms for SharePoint: Production
Dynamic Forms for SharePoint – Now with Tabs
Dynamic Forms for SharePoint: Now with support for SharePoint 2013

How to use the Content type as trigger

In NewForm and DispForm the content type is not visible other than in the URL. You must use the trigger “URL Query string parameter”, and “This value” like this:

ContentTypeId=YourContentTypeID

Please note that the default content type id not always shows up in the URL. If you click the “New Item” in the ribbon (in SP2010), it is included, but if you click the “Add new item” below the list view, it is not. You should therefore add rules for the “not default content type”.

How to find the ContentTypeId
Go to list settings, click the content type you want the id from, and then look at the URL. You will find it like this:

ctype=0x010300E461AB843CED5C47B6795DF8C440401A

In EditForm, you can select the content type select ine the trigger fields and address it by its display name.

Details on the side-by-side functionality

I have added an option to place fields side-by-side in the tabs like this:
IMG

The configuration is setup like this:
IMG

The yellow input fields is used to specify a common index number for the fields that are to be presented side-by-side. The fields will be lined up with the topmost field in the selection.

The checkbox is used to hide the form label for the fields like this:
IMG

Please consider the side-by-side functionality BETA, and report any bugs back to me by adding a comment below.

Alexander