We have built a multi-form process where in order to create a “report” for defective services/materials, however, a “roster” form needs to be filled out and submitted first. The “roster” form is also used to add to, delete from, or update a SQL table with the help of workflow on the backside.
Upon the “report” form load, a look-up to the SQL table where the “roster” information is stored executes and fills in the specified fields with the data stored in the table. The user completes and submits the form for review. So at this point we now have:
1) a complete & submitted “roster” form,
2) updated “roster” SQL table,
3) a complete & submitted “report” form, and
4) a new user task to review the “report” form and start approvals.
Roster form completed:
Report form completed:
The dilemma:
At this point, if you open the user task to review the report, you see the fields are all filled out – both the manually filled and pre-populated ones. If you:
1) close (‘X’ out, not Submit) the “report” form and
2) open the “roster” form associated with that “report” and
3) delete someone from the roster, and then Submit the form
Roster form updated: (Site Manager removed)
The workflow kicks off and it updates the “roster” SQL table. Now, if you open the user task, I can see the JavaScript functions happening (because of show/hides, alerts, etc.), but the look-up does not refresh to match the updated SQL table, meaning it still populates with the original data the form was submitted with.
Report with original data still (look-up did not refresh - Site Mgr still populated, should be empty):
So far I have tried:
1) removed the read-only (set in JavaScript instead of ‘Field Rules’) attribute for the value used for look-up.
- if you manually change the look-up value, the associated fields do change
2) adjusted the JavaScript to create a ‘change’ on the field hoping it would refresh the look-up tied to it.
$('#q140 input').trigger('change lookup'); $('#q140 input').on('change lookup', function(){ //alert('hit function'); });
- I have also tried clearing the field and repopulating, tried using element.change(), tried element.val().change(), tried copying to another field and using that variable for the look-up, but none of it works, in fact, using the element.val().change() combo completely crashes all of the Forms JavaScript for the form...
- I know the functions are still running because on page load I get the alert
3) verified the look-ups are pointing to the correct SQL tables
So, does Forms run the created look-ups on submitted forms within an active process? Is there a way to get that look-up to kick off again? Any help would be greatly appreciated!