Page 1 of 3

Workflow 2010 - Tasks

Posted: 16 Jul 2018
by Katerina.C
Hello,

I´m trying to edit form of workflow task of Workflow 2010. I tried to set buttons based on these instructions https://spform.com/buttons/customizatio ... oint-forms.

I changed in code field TaskOutcome to Outcome. But It is not working.

fd.field('Outcome').value('Rejected');
fd.field('Status').value('Completed');

Do you have experience with that? I can change field %completed, but Outcome not. So worklfow won´t go to next step after I complete task.

Thank you very much for any help.

K.

Re: Workflow 2010 - Tasks

Posted: 16 Jul 2018
by Nikita Kurguzov
Dear Katerina,
So, this code works?

Code: Select all

fd.field('Status').value('Completed');
But this one doesn't, correct?

Code: Select all

fd.field('Outcome').value('Rejected');
Please, select the the Outcome field on the form, make sure it's present and check its InternalName, it must match the one that you are using in your JavaScript:
InternalName.png
InternalName.png (4.54 KiB) Viewed 2523 times

Re: Workflow 2010 - Tasks

Posted: 17 Jul 2018
by Katerina.C
I checked InternalName. It was WorkflowOutcome. I changed it in code, but it is still not working.

Code is:

fd.field('PercentComplete').value('100');
fd.field('Status').value('Completed');
fd.field('WorkflowOutcome').value('Approved');

PercentComplete and Status works correctly.

Re: Workflow 2010 - Tasks

Posted: 17 Jul 2018
by Nikita Kurguzov
Dear Katerina,
What type of field is it? It might need a different type of input.

Can you open the form in a browser, select Outcome to be 'Approved', open console and write the following code? Press enter after inputting:

Code: Select all

fd.field('WorkflowOutcome').value();
Whatever you get as an output, should in theory work as an input in your code.

Re: Workflow 2010 - Tasks

Posted: 18 Jul 2018
by Katerina.C
I think this some special Text field created by Workflow 2010. If I click into Content Type, column WorkflowOutcome is not in Columns. I can see it just in view of Task list and Forms Designer.

I tried to write fd.field('WorkflowOutcome').value(); in console, but I get message that fd is not defined.

Re: Workflow 2010 - Tasks

Posted: 18 Jul 2018
by Nikita Kurguzov
Dear Katerina,
If this is the case, it might be tricky to do. Are you opening this form in dialogue mode? Otherwise, the fd variable should be defined. You can either try to open it in full screen or add the following line to Forms Designer's JS Editor:

Code: Select all

window.fd = fd;
And try the same code once again from the console.

Re: Workflow 2010 - Tasks

Posted: 13 Aug 2018
by Katerina.C
I got this message:
workflow.PNG
workflow.PNG (11.73 KiB) Viewed 2492 times

Re: Workflow 2010 - Tasks

Posted: 13 Aug 2018
by Nikita Kurguzov
Dear Katerina,
Not sure, are you inputting - fd.field('WorkflowOutcome').value(); or fd.field('WorkflowOutcome').value("Approved"); ?
To return a value, you need to input specifically:

Code: Select all

fd.field('WorkflowOutcome').value();
I assume that fd.field('WorkflowOutcome').value("Approved"); doesn't work from the console either, correct?

Re: Workflow 2010 - Tasks

Posted: 16 Apr 2019
by RMIC
Hello,

I have the same problem. Is there a solution to this, how the column "WorkflowOutcome" can be set?

Re: Workflow 2010 - Tasks

Posted: 17 Apr 2019
by AlexZver
Dear RMIC,

Have you tried this approach? https://spform.com/buttons/change-appro ... -edit-form