Forum Replies Created
-
AuthorPosts
-
We have almost got this working like we want, but when the JS creates the new record in List 1 it does not populate the _DFFSID or _vLookupID. They will populate once you open/save the newly created record, but we really need the _vLookupID for the Looping Workflow for creating the other record.
Haven’t had a chance to look at this and won’t be in the office but an hour in the morning. Can’t wait to try this.
The end users is creating a record in List 1 with [Facility], [Shift], and pre-populated [Date].
Could something create a new record but with the next [Shift] when the user sets a field in their record?
Maybe the user has a checkbox [CreateNextShiftReport]?The new items in List 1 are shift reports for each [Facility] and [Shift] and would need to be created at specific times each day.
[Facility] [1stShift] would need to be created everyday at 0500
[Facility] [2dShift] would need to be created everyday at 1300
[Facility] [3rdShift] would need to be created everyday at 2100and that JS created record would need to create the items in List 3 or at least trigger the Looping Workflow.
Version information
DFFS frontend: 4.4.3.65 – March 31, 2019
DFFS frontend CSS: 4.46 / 4.46
Autocomplete: 1.6.28 – January 12, 2019
Cascading dropdowns: 3.7.26 – March 31, 2019
jQuery: 1.12.4
Lookup: 1.1.16 – March 05, 2019
Resource management: not loaded
SPJS-Utility: 1.332 – March 05, 2019
vLookup: 2.2.129 – March 07, 2019Using 2013 Workflows as 2010 Workflows do not support looping
No errors in the developer console and all the fields are visible. The first field is actually a people picker – I changed that to a text field calculated on the people picker and got it to work – but the other calendar/list is still plugging along… I guess I need to change that over too in case it fails.
I would be interested in Keith’s approach as well.
I am an idiot… I got it to work
Andrew – I work with Brett who responded above and she can’t figure out where I am screwing up. This WAS working a few days ago and I don’t know what kinked it up.
I have a people picker that is only entered on the NewForm and I want to pull out LastName & FirstName into their own fields. I cannot get LastName FirstName fields to display in the DispForm. They display fine on the EditForm.
Do I need code on all three forms or just one?
This is the code I am using on the NewForm and EditForm
function PopulateLastFirst () { //Pull in Last Name and First Name from Employee field. $.each(spjs.utility.getFieldValue({"fin":"Employee","key":"loginName"}),function(i,login){ var ppData = spjs.utility.userInfo(login); console.log(ppData); // User profile is not available in SP Foundation var userProfile = spjs.utility.userProfile(login); console.log(userProfile); setFieldValue("Last_x0020_Name",userProfile.LastName); setFieldValue("First_x0020_Name",userProfile.FirstName); }); }
This is the code I have on the DispForm
function PopulateLastFirst () { $.each(spjs.dffs.beforeProperties["Employee"],function(i,userId){ var ppData = spjs.utility.userInfo(userId); console.log(ppData); // User profile is not available in SP Foundation var userProfile = spjs.utility.userProfile(ppData.Name); console.log(userProfile); setFieldValue("Last_x0020_Name",userProfile.LastName); setFieldValue("First_x0020_Name",userProfile.FirstName); }); }
I even tried this on advice from Brett… on the DispForm
function PopulateLastFirst () { $.each(spjs.dffs.beforeProperties["Employee"],function(i,userId){ var ppData = spjs.utility.userInfo(userId); console.log(ppData); // User profile is not available in SP Foundation var userProfile = spjs.utility.userProfile(ppData.Name); console.log(userProfile); }); }
Any help you could give would be much appreciated.
Never mind – it is working now… I think LOL
If there is a better way I still would appreciate it.
-
AuthorPosts