Forum Replies Created
-
AuthorPosts
-
Oh, I think I see why, it’s based on when the child form loads. I’m using vLookupPresetFromURLDone(fin) but it’s almost like it needs to literally wait until everything has loaded to capture. I have it on dff_ready and that doesn’t seem to work either.
I’m not sure if there is another onLoad option.
My apologies, in the title it should have said “Only works on Edit form”
Ok, I’ll try that out. In terms of when/where the action would occur it would be after returning to the main form from child form and/or during dffs_ready and pre-save.
I’m doing light “data integrity” between what the requestor chooses in the main AC, and what is/isn’t available as a list item in a vLookup/child list. Only Admins can add to the vLookup/child list and I wanted to attempt to auto-update the AC values on the main form to reduce manual updating.
Right now, I have it set up where if a requestor adds items in the main AC field, when they save the request, the selections are then created as list items in the child list for additional usage and future reporting opportunities.
-
This reply was modified 3 years, 9 months ago by
Jonathan Stamper.
Does setFieldValue work for a multi-select AC? I’m trying to use the logic from the manual below but I may have it in the correct format for a multi-select.
spjs.ac.setFieldValue("AutocompleteFieldInternalName","The_Selected_Value");
July 22, 2021 at 18:04 in reply to: Wait for From and To values to populate before running autocomplete #34148Oh cool! That should work better! Thank you so much for all the help.
July 21, 2021 at 22:06 in reply to: Wait for From and To values to populate before running autocomplete #34129Ah-ha! I just wrapped the ac in
window.addEventListener(‘load’, function(){ spjs.ac.textfield({…}); });
That seems to have worked, unless there is a better approach.
I got it working. I ended up just using the .css(“visibility”,”visible/hidden”) action with conditionals for the button and table.
I couldn’t get options mentioned for spjshidden to work without it reappearing when I clicked to another tab or showing once I clicked to another tab and then returned.
For some reason, when ran in dffs_ready, the button or table won’t show/hide initially until I go to another tab then return to the attachments. No issues in the code nor on the console. I do have the setting turned on to remember where you left off on the form. Could that be causing he issue or maybe Should put them in an onload/ready function?
Actually as an update, I turned off the “remember” functionality but that causes me to have to click the attachments tab, click another tab then back to attachments to see the button or table.
-
This reply was modified 3 years, 9 months ago by
Jonathan Stamper.
I think I got it. I created a button that initiates the attachment setup, creating the folders and sub folders. The only thing left is preventing the vLookup from initiating until after the attachment setup click, or would it be better to have the vLookup wrapper hidden instead and then just JQuery to show and refresh?
Ah ok, I thought I had seen an old post mentioning it didn’t have a rename capability. Thanks for that info.
For the folder creation, that may be a better idea. Have a button that “initiates” the table so it can create the folder or check if the folder is there and create if not? Trying think of how to best code that up.
That is perfect and it works! I was about to have to recreate my own upload page which I didn’t want to do so many many thanks!
2 more questions:
- Does spjs.dffs.updateListItem have a renaming conventions for folders?
- I realized that creating a folder on new item will also continue creating folders when pressing refresh or F5 on the new item form. Aside from creating an event listener on the F5 keyboard press, is there one that exists for pressing the refresh button on a browser?
Again thank you so much for all the help!!
-
This reply was modified 3 years, 9 months ago by
Jonathan Stamper.
I’m really close and decided to change the logic to only occur when a new item is initiated (dffs_ready).
- I have it creating a folder in the child document list using the vLookupID with the “:” replaced with “_”on New Item only
- I also did more research in the vLookup settings and am able to point the table settings to look at the folder destination using a global variable – {var:parentFolderName} and set that as the default.
- If the user cancels the request it deletes the folder.
Where I’m stuck is hiding the destination folder field and choose field button that show up when adding an attachment. I was hoping a simple css removal in my custom css would do it but it’s not setting the display to none.
Would you have any ideas or any feedback on above or a better option?
Thank you and great point and tip. I managed to get the logic working for loading to the custom people picker on the alert.
Now I just need to work out the configurations on sending the auto emails. First time using it in DFFS and look forward to checking it out.
Ah, I just figured it out with where to execute the function. It’s just right below the custom alert like this:
function doEmailSend(id){ var htmlDiv=“<div style=‘Width:550px;’> + “<label>Select users to email</label>” + “<div id=\”userEmails\”></div></div>”; spjs.dffs.alert({ “Title”:”Email Observation”, “msg”:htmlDiv … }); $(#userEmails”).spPeoplePicker(); }
Then the people picker is set up using logic courtesy of https://www.enjoySharePoint.com/client-side-people-picker-in-sharepoint-online-using-javascript/
I’d still like to check to make sure that’s the best practice and if usable for collecting the email addresses and sending the emails.
-
This reply was modified 3 years, 9 months ago by
-
AuthorPosts