Forum Replies Created
-
AuthorPosts
-
Thank you Alex. I had not looked at the earlier post, so I’ll see how far we get with that. There are very smart people helping me with this effort, so that blog should give us/them the hints we need to play with inline editing. I’ll let you know how it goes.
I do it by setting the field to {currentUser:Email}. Using JUST {currentUser} inserts first and last name as separate entries which does not resolve correctly. The results may be different in different SharePoint farms.
Travis, I think you could accomplish that with existing functionality quite easily by using the “Load these CSS files ” section in the Custom CSS settings page in the DFFS configuration for your forms. Save your custom css as a css file, store it in your SPJS library, and then just add the reference when you create a new form.
I *THINK* there is even a way to add it to the “Plugins” folder in the SPJS library so it is automatically included in every form. Check the DFFS manuals (Installation and User Guide) online.
Josef,
This sounds like a permissions issue. If you have Check In/Check Out turned on in your SPJS library and did NOT check in the DFFS files in your SPJS library, your users won’t be able to read them, hence they will get the native SharePoint form.
It that is not the issue, check user permissions in the permission settings for the SPJS library using the “Check Permissions” icon in the ribbon. Also, make sure that permissions have not become fragmented in your library. Look for the yellow information bar on the permissions settings page for the library (or the site, if your SPJS library inherits its permissions from the site itself) and if it says “Some content has different permissions: click here” follow that link to find fractured permissions and re-inherit up to the SPJS library level.
Good luck tracking it down!
As an alternative, would it be possible to use the vlookup functionality to create new items passing in fields from the current item, by selecting the current list as the target of the vlookup? It seems to me that I have used vlookup to SEE related items on the same list — would that also work for creating new items on the same list?
Using vLookup from the New from when no ID is needed.
Currently (release date 2019-01-12) in order to have the vLookup functionality operate on the New form, I must include the _vLookupID column on my parent list even if I am using a different field to identify the child records I want displayed. (I’ll give the use case below.)
My user asked how to create the equivalent of an Infopath Repeating section in DFFS. The example she gave me was based on the child records sharing the same AU (stands for ‘Accounting Unit’, similar to a GL code in an accounting system) as the parent records, which doesn’t rely on the ID of the parent record OR the ID of the child record, but I still had to add the _vLookupID column on my parent list for the vlookup config to work.
If it is easy to turn off that validation when someone is not using the ID column on the parent list to relate to records on the child list, it would make setting up the lists easier for my user’s use case.
USE CASE: One team supports many applications. All the applications supported by the team fall under the same AU (think GL code) as the team falls under. The purpose of the new system is to show which applications are supported by different teams (select Manager name and see all the applications the team supports.)
A table of some applications and the AU’s they fall under is already available so the child list could be pre-populated through a bulk load. When adding a new manager to the parent list on the new form, immediately all the applications supported by that manager would show up on the form. Apps supported by the manager’s team NOT already pre-poplulated would be added individually on the parent list new form. At no time would the ID of the parent record be needed to find the related records on the child list.
#2: All I can suggest is experimenting with different placement of the line break tag. In this case, trial and error is your friend.
1a. Here’s JS code to get a timestamp. Wrap it in a function and call it. Modify it as needed to get the portion of the timestamp you want.
var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear(); if(dd<10) { dd='0'+dd } if(mm<10) { mm='0'+mm } today = mm+'/'+dd+'/'+yyyy;1b. By looking at the tooltip for “Set Field Value” on the Rules configuration page in DFFS, we see we can use {timestamp[dd.MM.yyyy hh.mm.ss]} to format the DFFS timestamp function. So, you could try changing the line
var dateTime=spjs.dffs.buldValStr("{timestamp}");to
var dateTime=spjs.dffs.buldValStr("{timestamp[dd.MM.yyyy]}");I have never tested this.
Good luck.
Separate answer coming for #2 once I have time to parse the question.
-
This reply was modified 7 years, 5 months ago by
Keith Hudson.
-
This reply was modified 7 years, 5 months ago by
Keith Hudson.
Sorry for the delay in responding.
I am attaching a Word document with code and screenshots to explain my approach when using an Enhanced Rich Text field. In this approach, the author and timestamp is bolded.
Mike;
I’ve now seen used the DFFS email capability used on one project where it seemed to work well, but I’ve also heard feedback from other users that seem to have found it gave them inconsistent results.
What has your experience been?
Mike, I’m glad the nested if statements in a calculated field worked for you. You mentioned that workflows can fail to keep up (I assume you mean that they may not run in a timely manner reliably). *IF* you are the farm admin, and if the lack of reliability is due to long delays in workflows executing, you MIGHT be able to make them more reliable. There is a setting in Central Administration for how many workflows can be processed simultaneously. The default is 8. I have seen a white paper written by someone who tested increasing that setting to 25,000 with no observable performance issues in their environment. Just a thought. Most of us are NOT the farm admin, so we are stuck with whatever settings the farm admin chooses, and most farm admins wouldn’t know about that setting, or would be afraid of breaking a site by changing it.
If you have already made sure you have a function called toggleCreateButton1, try copying that function and pasting it into jshint.com to see if there is a syntax or typing error in the function that is causing it to break.
As Alex indicates, the custom javascript function you wrote in DFFS will not work in the Quick Edit view, because it relies on the underlying DFFS code that Alex wrote only for use on the new, edit and display forms.
To illustrate, I will refer to the two fields you are dealing with as the Source field and the Target field. From your original post, it sounds like your Target field is in fact a SharePoint lookup field. If that is true, then my first idea below will not work.
First idea:
Change the Target field to a calculated field (by deleting the original Target field and creating a calculated field of the same name). Use nested if statements to set the value of the Target field as you did in your custom javascript function. You can’t use a switch statement, but you can use the AND, OR and IF functions in a calculated field. (Lots of info on those functions in google).If that approach WILL work for you and you have trouble getting the formula for the calculated column set up, post here and I’ll try to offer some help.
Second idea:
If the Target field must remain a Lookup field, you could remove it from the view on which users are making their changes (or simply instruct them to ignore it) and use a SharePoint Designer workflow that fires every time an item is changed to apply the logic that will update the Target field with the value you want it to have.
My javascript skills do not come anywhere close to Alex’s, but here are two approaches to solve this issue. I would create a rule that fires a javascript function every time the value of Column A changes, and use a javascript function to to set the field value of the lookup field.
Version A: uses a javascript switch statement (You can read up on what a switch statement is here: https://www.w3schools.com/js/js_switch.asp) (Although this is not the most efficient way to meet your need, I’m including it because it is so useful for situations very similar to yours.)
Here’s the javascript function, using sample values:
function updateColumnA(){
var colA = getFieldValue(‘ColumnA’); //make sure you use the internal field name
switch(colA) {
case ‘1’:
setFieldValue(‘LookupField’,’Name 1′);
break;
case ‘2’:
setFieldValue(‘LookupField’,’Name 1′);
break;
case ‘3’:
setFieldValue(‘LookupField’,’Name 1′);
break;
case ‘4’:
setFieldValue(‘LookupField’,’Name 1′);
break;
case ‘5’:
setFieldValue(‘LookupField’,’Name 2′);etc.
default:
//code block (you may or may not need a default code block)
} //end of switch statement} // end of function
NOTE that the tick marks around the case values is required if your values are strings, and NOT required if Column A is a number column. You’ll have to create one ‘case’ statement for each value of ColumnA, which in your case (you are mapping several values of ColA to a single value in LookupField), is a bit repetitive, so you might prefer approach B, below.
Approach B:
function updateColumnA(){
var colA = getFieldValue(‘ColumnA’); //make sure you use the internal field name
if (colA === ‘1’ || colA === ‘2’ || colA === ‘3’ || colA === ‘4’){
setFieldValue(‘LookupField’,’Name 1′); //use the field internal name for LookupField
} //end of first if statement
if (colA === ‘5’ || colA === ‘6’ || colA === ‘7’ || colA === ‘8’){
setFieldValue(‘LookupField’,’Name 2′); //use the field internal name for LookupField
} //end of second if statement
etc.
} // end of functionUse as many if statements as needed. If ColA holds numbers, don’t use tick marks around the values in the if statement.
Good luck.
William, I just saw this about code to hide a tab. The id of the tab is “dffs_tab_5” where 5 is the tab index. So, you can just use $(‘#dffs_tab_5’).hide() to hide tab with index 5.
-
This reply was modified 7 years, 5 months ago by
-
AuthorPosts