Forum Replies Created
-
AuthorPosts
-
Sorry, I missed your reply. The problem is that you in the “Build query” part queries the child list for items where the field _vLookupParentID is equal to the current items ID, but you are not transferring the ID to the child item in the “Prefill values in child”.
If you want to use the parent items ID to link to the child items you must change this line
From _vLookupID to _vLookupParentID
to
From ID to _vLookupParentID
Alternatively you can change the Build query “Search value” from [currentItem:ID] to [currentItem:_vLookupID]
Alexander
1. To do this you can use the function dffs_vLookup_callback (see this post for instructions). If the field you want to read back to the parent item is not in your vLookup table you can include it in the “Include additional fields for use in customizer functions” dropdown at the bottom of the Build the table tab.
This function will show you all the child items as an array and you can loop through them to get the value you want.
Alternatively you can add a PreSaveAction like this in your child form:
dffs_PreSaveAction = function(){ child_status = getFieldValue("Status"); return true; }
This variable (because it is not defined with var, let or const) will be available in Custom JS in the parent item. You can use the dffs_vLookup_callback function to pick up the variable and write it to a field in the current item.
2. There is no built in support for nested vLookups so that must be done using custom js.
Alexander
Not sure why it did not work when you used a file, but based on the fact that you use the old JSLink installer, I assume you use an older version of DFFS. If you hover over the Enhanced with DFFS link below the form and click the License and version information link you can see the version numbers.
The SP Services license is an OEM license for the core functionality that they deliver. This means you cannot use that license for additional lists that are not part of the package delivered by SP Services.
If you want to use DFFS in additional sites you must purchase a site or site collection license.
Alexander
I have created a test config that you can import into a list. It will show you how to use the custom js and call one of the functions from a HTML section.
Create a new list with only the title field and install DFFS. Go to the Export, import and restore tab and import the config by copy pasting from the attached file.
Please note that the function will obviously not work in this test list because the target fields are missing.
It looks like my attachment plugin suddenly blocks txt files – trying again with a zip.
Alexander
- This reply was modified 5 months, 2 weeks ago by Alexander Bautz.
Attachments:
To answer that I must see the vLookup configuration (export and attach as txt or screenshot the full configuration).
Alexander
txt-files should be no problem to upload. Can you ensure it is a proper .txt file and try again? – if not, see the Contact tab above and email it to me.
Alexander
The solution uses this control to render the taxonomy picker: https://pnp.github.io/sp-dev-fx-controls-react/controls/TaxonomyPicker/
My guess is that there is some caching built into the control. Have you tried opening a new fresh tab and see if it shows the new terms?
Alexander
My first thought is that you had the code wrapped in a block (function or if-statement) so it was not available in the global window namespace, but without seeing your entire custom js code I cannot tell for sure.
In general you can add functions to the Custom JS code editor and call the functions from a button in a HTML section or by calling them from a rule.
Alexander
Thanks, can you also explain how / when you trigger the functions?
Alexander
Can you export your vLookup config and attach it as a txt file so I can look at it?
Alexander
Without looking at the code I’m not able to give you any recommendations on how to fix it.
If you can attach the code as a txt-file I’ll take a look.
Alexander
If you can show me the code you use I can have a look at it.
Alexander
Strange. Are you sure you use the same field / same config in those two forms?
If you do, are there any errors in the developer tools console (F12 > Console)?
Alexander
I tested with a user with no email and got the same error. I’ll get this fixed in the next release.
Alexander
I tested your config and also changed to CZECH language, but cannot reproduce the error.
I think the problem can be that the logged in user does not have an email address in the user profile – could that be the issue?
You can check it by typing this in the console when you have the form open:
dffs_userProfile
Alexander
-
AuthorPosts