Home › Forums › Classic DFFS › People Picker in Custom Alert
Tagged: Custom Alert, email, people picker, vlookup
- This topic has 3 replies, 2 voices, and was last updated 3 years, 4 months ago by Jonathan Stamper.
-
AuthorPosts
-
-
June 30, 2021 at 15:47 #33994
I have a vLookup table of Observations and within each observation is an inline button called “Send Email.” Clicking that button opens the custom alert with a div ID of “userEmails” inside “msg.”
What I’m trying to do with the DIV is create a custom People Picker field that auto populates from 2 other people picker fields on the main form and also allows the user to add more users to send the email to. When they select send email it will take that list of people send them an email, set a child email flag to yes, and refresh the vLookup table so as to hide the send email button on the table.
Is something like this possible to do or am I way over my head? I have logic to create a custom people picker but not sure how/if you can execute within the html of the custom alert.
-
June 30, 2021 at 16:29 #33996
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.
-
July 1, 2021 at 16:32 #34017
If it works for you I’m sure it is OK.
Please note that you don’t have to load all the scripts associated with the people-picker code as they should already be loaded with your NewForm or EditForm – if you are using this in DispForm however you must load all scripts not already loaded (look at the Network tab to see what is loaded).
Alexander
-
July 2, 2021 at 15:20 #34030
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.
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.