I have a Workflow Task (Sharepoint 2013) content type which is displaying odd behavior; built in Plumsail Forms 2.0.1. Here is the code I'm using:
In the display form I use a redirect, so the user doesn't need to manually switch to the Edit form:
fd.spRendered(function() {
var origUrl = window.location.toString();
var editUrl = origUrl.replace("DisplayForm","EditForm");
window.location = editUrl;
});
In the Edit form I hide the task fields:
fd.spRendered(function() {
fd.field('TaskOutcome').hidden = true;
fd.field('Status').hidden = true;
});
On the Submit Button I have:
fd.field('TaskOutcome').value = 'Approved';
fd.field('Status').value = 'Completed';
return fd.save();
When the form is first opened it does switch to the Edit form, however the form field are not properly populated (Task Name, Assigned to). The form need to be submitted and reopened and then be resubmitted to work.
Dear @bnunweiler,
And why should they be populated? Is it default behavior or is it somewhere in the code? Or does a user populate them and it doesn't save?
The more information the better, some screenshots wouldn't hurt either.
Dear @bnunweiler,
Not sure it's related to the Workflow, can you check the console for errors? Also, what happens when you open the Edit form normally?