All posts by Alexander Bautz

Heads up on an upcoming price adjustment

On July 1, 2019 I will increase the price on the Site license for Dynamic Forms for SharePoint (DFFS), SPJS Charts for SharePoint (Charts) and CommentBox for SharePoint (cBox).

This is the changes:

DFFS: From $50 to $100.
Charts: From $50 to $75.
cBox: From $50 to $75.

The price for a Site Collection license will not change this time.

Best regards,
Alexander

DFFS Rule reversing explained

One of the main areas of confusion when using DFFS is the automatic rule reversing of rules that are NOT evaluated to true.

This example show how most users first set it up and ends up with the wrong result. I’ll first show how it is set up to make it fail, and then I’ll highlight the missing part at the bottom of this post.

The example form

Let’s say you have a choice field TabVisibility that controls the visibility of a specific tab. For this example I have created a choice field with two values: Show and Hide, an have set up three rules.

The tabs:

Tab is set to hidden but this will not work because the rules show below will override it.

The rules:

One for hiding the tab when the TabVisibility choice field is empty:

One for showing the tab when the value is Show:

And one for when the value is Hide:

This is how it looks when loading NewForm and the value in TabVisibility = blank, but it is not doing what you expect:

This must be wrong – the tab is not hidden???

Why this is not working

When you have trouble with a form you should always use the Debug this rule setting:

This will show you the debug panel below the form:

When the form loads, each of the three rules are evaluated. The first rule is evaluated as “true” and hides the tab as it should:

Hides the tab.

Then the next rule runs and is evaluated as “false” and does the opposite of what it is configured to do. It doesn’t do anything wrong here because the tab is already hidden, but you see where this is going:

Should show the tab if true, but reverses and hides the tab instead.

Then the last rule comes in and messes it up by showing the tab despite it being set up to HIDE the tab and not to show it:

Shows the tab because the rule is reversed when not evaluated to true.

Why is this happening?

The reason for this behavior is to avoid writing two rules for every action and just let DFFS handle the reversing – for example if a Yes/No field is checked: show some fields, set some fields required etc. Then if the field is unchecked, all visible field are hidden, required fields are set as optional etc. This is by design to limit the number of rules required to make a dynamic form.

This will however create problems when you use multiple rules on for example a single choice column as described above.

How to fix it

In this scenario you must use the No reversing of this rule setting in each of the three rules (optionally you can check the Disable reversing of all rules in the top of the Rules tab):

No reversing set on each rule.

When you have done this your NewForm will load correctly and hide the tab:

That’s it – post any comments below, or use the forum.

Alexander

Copy the list definition to a file when filing a DFFS support request

The code snippet linked below is used to dump all the list fields to a file to enable me to recreate the list when investigating a possible bug in DFFS.

How to use the snippet

Go to the DFFS enabled list you want to copy, and change the URL from …/Lists/ExampleListName/ExampleViewName.aspx to …/Lists/
ExampleListName /NewForm.aspx.

Hit F12 to bring up the developer console and paste the code directly in the console and hit Enter.

This will download the field definition as a file that you can email to me or attach in a forum post.

The file only contains the name and description of the fields, and choices in a choice field so there should not be any compromising information in the file.

Get the code snippet

Get the file her

DFFS Package updated to v4.4.3.65

I have fixed a few small bugs – you find the change log here, and the updated files in the download section of the user manual.

PS: The date on the zip file is 2019-03-31 – I just didn’t find time to publish it until now.

Post comments below, but use the form if you have questions or you think you have found a bug.

Best regards,
Alexander

DFFS Package updated to v4.4.3.64

I have fixed a bug with using multiple rules triggering on change / change from initial value on a multichoice field resulting in only the last rule on this trigger to actually run.

You find the change log here, and the updated files in the download section of the user manual.

Post comments below, but use the form if you have questions or you think you have found a bug.

Best regards,
Alexander

DFFS Package updated to v4.4.3.63

I have released a new version of the DFFS package (v4.4.3.63) that replaces v4.4.3.62 that I released yesterday.

I was made aware of a major regression bug that I accidentally introduced while fixing and issue with using multiple rules triggering on change of the same field.

I have pulled the previous version and updated the change log here.

You find the updated files in the download section of the user manual.

Post comments below, but use the form if you have questions or you think you have found a bug.

Best regards,
Alexander



DFFS Example: Limit access to form

This example show how you can use a set of rules to ensure only persons assigned in a people picker in the form, or members in an admin group can view or edit a list item.

Add these three rules:

This rule doesn’t have any actions.
This rule doesn’t have any actions.
This rule checks the two previous rules, and calls a function if both are false.

Then add this function to your Custom JS:

function noAccessToThisForm(){
jQuery("#part1").hide();
spjs.dffs.alert({
"title":"No access",
"msg":"You don't have access to this list item.",
"ok":function(){
window.history.back();
}
});
}

You can use this setup in both DispForm and EditForm, and it will show this message box if the user doesn’t have access:

Post any questions below, or use the forum.

Alexander