Forum Replies Created
-
AuthorPosts
-
Alexander BautzKeymaster
This should be fixed in the new version – can you test it and let me know how it works?
Alexander
Alexander BautzKeymasterI have released the new version – check it out and let me know if you still have problems.
Alexander
February 1, 2024 at 22:37 in reply to: Can I have an example of calling a jscript function from a rule #37451Alexander BautzKeymasterYes
February 1, 2024 at 16:31 in reply to: Can I have an example of calling a jscript function from a rule #37449Alexander BautzKeymasterDid you use the dffs_fieldChanged function from the Custom JS example thread?
You should be able to do it something like this:
function dffs_fieldChanged(fin, new_value, previous_value) { switch (fin) { case "fieldA": setFieldValue("fieldB", new_value.substring(0, 10)); // 10 first characters of fieldA is written to fieldB break; case "fieldC": setFieldValue("fieldD", new_value.substring(0, 10)); // 10 first characters of fieldA is written to fieldB break; } }
Alexander
Alexander BautzKeymasterHi,
I’ll have to test this and see if I can replicate it. Can you email me screenshots of the setup and the error so I can set up a similar test?Alexander
Alexander BautzKeymasterI’m planning a new version hopefully over the weekend, but I’m not sure if I’ll be ale to get this one in that release – I’ll see what I can manage. If not, it should be fixed in a week or two.
Lists already work as the form is the primary input so you fill in the form and save.
Alexander
Alexander BautzKeymasterThis is not an option in the current version, but I’ll look at adding that functionality in a future version.
Alexander
Alexander BautzKeymasterI’m planning to release a new version during or over the upcoming weekend.
Alexander
Alexander BautzKeymasterThanks, I think this helped. I’ll include a fix in the next release.
Best regards,
AlexanderAlexander BautzKeymasterGood idea, I’ll look into it for the next version.
Alexander
Alexander BautzKeymasterIt must be a permissions problem. I’m actually not 100% sure, but you might have to be a site collection admin to be able to list all subsites.
What you can do if this is a problem is to install the Charts solution in the subsite your coworker is trying to access.
Alexander
Alexander BautzKeymasterThere is unfortunately no function to block the selection of the dates, but you can run a validation after the user has picked the date by adding some custom js and a rule.
Add this to your custom js:
function validateDateField() { var dateFieldInternalName = "DateColumn1"; jQuery(".customDateValidation").remove(); var today = new Date(); var date = spjs.utility.getDateFieldAsDateObject(dateFieldInternalName); var requiredDateOffset = 6; var diffDays = (date - today) / (24*60*60*1000); if (diffDays < requiredDateOffset) { jQuery("#dffs_"+dateFieldInternalName+" td.ms-formbody").append("<div class='customDateValidation' style='color:red;'>The date must be atleast <strong>"+requiredDateOffset+"</strong> in the future.</div>"); jQuery("#dffs_"+dateFieldInternalName+" input").val(""); } }
Change “DateColumn1” to match your date field internal name.
Now add a rule that triggers on “is changed” on your date field and add the name of the function to the “Run these functions / evaluate these rules” field like this:
validateDateField
When a selection is made in the field, this code checks if the value selected is 6 days in the future and shows a message and clears the value if it is not at least 6 days ahead.
Alexander
- This reply was modified 3 months, 1 week ago by Alexander Bautz. Reason: Fixed code snippet format
Alexander BautzKeymasterI’ll fix this in the next version.
Alexander
Alexander BautzKeymasterNewForm and EditForm configurations are often different to let the first person use a simple form and then have a more complex form with more fields in editform.
I think the best solution would be to add an option to turn off quick save (I’ll look at adding that to the next version) so you can use the dffs_PostSaveAction custom js function to redirect to the EditForm configuration.
Alexander
Alexander BautzKeymasterHi,
If you look at this thread and find the Do something before the item is saved section you can just use getFieldValue(“Your_field_name”) to get the value to build your new variable with the changes, and setFieldValue(“Your_field_name”, your_variable); to write it back to the field.Alexander
-
AuthorPosts