Home › Forums › Classic DFFS › DFFS does not recognize workflow created list record
Tagged: workflows
- This topic has 15 replies, 2 voices, and was last updated 5 years, 2 months ago by Alexander Bautz.
-
AuthorPosts
-
-
May 23, 2019 at 21:39 #25430
Ok… Let’s see if I can make this half way understandable.
TL/DR – if a workflow creates a record in a list, DFFS does not recognize the new record and does not process any rules. So it is not recognizing when the form is initiated, ready, or saved. I guess part of the issue is that the workflow isn’t using the form at all… Is there anything that I can trigger via a workflow that will cause DFFS to kick in??
List 1: Shift Report – parent vlookup of List 3
List 2: Master Roster of staff
List 3: Staff Assignments – child vloopup of List 1I have a workflow that starts with a new record being created in List 1 and it then runs a loop if [Facility_Shift] matches in List 1 and List 2. The loop then creates a record in List 3 if other fields meet the set criteria. Part of the reason it runs so slow is I have to add so many fields that should be populating with a cascading dropdown once the record is created.
This workflow works fine, but it is extremely slow to run through the loop, delaying the end user for completing the rest of the form.
I had the thought to create a workflow that would create the record in List 1 and then wait 24 hours and create it again. That workflow works fine. But again that workflow created record does not trigger any DFFS rules in the newly created record.
I am at a loss of how to proceed…
Attached screenshot of workflow
Attachments:
-
May 23, 2019 at 21:54 #25433
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
-
May 25, 2019 at 12:31 #25458
Hi,
Sorry, but there is no way to trigger the DFFS rules from a workflow. DFFS only “lives” when you open the form in the browser.I didn’t understand exactly what your forms should do exactly, but it is possible to create items in another list with JS from DFFS so you might be able to do what you want without the workflow.
If you have some more details on what should happen when a new item is created in “List 1” I might be able to get you started with a JS solution.
Alexander
-
May 27, 2019 at 16:15 #25483
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.
-
May 27, 2019 at 21:37 #25489
I see, unfortunately there is no way to use DFFS like this when you need them created on a schedule.
Alexander
-
May 28, 2019 at 14:09 #25496
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]? -
May 28, 2019 at 19:53 #25499
Yes, you can add a list item in a list like show here: https://spjsblog.com/forums/topic/create-a-new-item-in-list-b-prefilling-common-fields-from-list-a/
You can trigger this function from a DFFS rule when the checkbox “CreateNextShiftReport” is checked and the form is saved by changing the PreSaveAction function (from the linked code snippet in the link above) like this:
function PreSaveAction(){ // If the checkbox is checkde and it was not checked when the form was loaded if(getFieldValue("CreateNextShiftReport") && !spjs.dffs.beforeProperties.CreateNextShiftReport){ addItemInListB(); } return true; }
Alexander
-
May 29, 2019 at 04:01 #25506
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.
-
May 30, 2019 at 21:36 #25525
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.
-
May 31, 2019 at 09:39 #25528
Hi,
I’m glad you are making progress!To add the two IDs you must generate them and pass them to your new item. The vLookupID is generated like this in the vLookup script:
data._vLookupID = _spPageContextInfo.userId + ":" + new Date().valueOf();
and the _DFFSID is generated like this:
data._DFFSID = new Date().valueOf();
Add these two lines to the code you use to create your new items and you should be good to go.
Alexander
-
June 1, 2019 at 17:20 #25545
Beers on me Friday (payday)!!!
-
June 3, 2019 at 16:47 #25558
I guess you got it sorted out?
Alexander
-
June 3, 2019 at 20:15 #25573
Well… my colleague did all the work… I just asked you the questions. LOL
Seriously though it works perfectly and is exactly what we needed. -
June 3, 2019 at 20:33 #25575
That’s great news!
Alexander
-
September 11, 2019 at 20:49 #27064
Hey Alexander – This is working wonderfully with one issue… if somehow the user gets to the point that creating the new record is ready, but gets a Save Conflict error… What happens is when they refresh or cancel the new record is created. They then go back and attempt to enter more information and a second new record is created… sometimes as many as 4-5 depending on how persistent the user is.
Is there anything that can check and see if the record is already there and not create a newer one?
-
September 12, 2019 at 20:22 #27079
You could use another query to check if the record has already been added. Try adding this in the top of your function (before the part where you create the new item):
var alreadyAdded = spjs.utility.queryItems({ "listName":"The_List_Display_Name_or_GUID", "query":"<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Searh_value</Value></Eq></Where>", "viewFields": ["ID"] }); if(alreadyAdded.count > 0){ // Already added - skip return; }
Change the CAML to match your field and search value.
Alexander
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.