How to programmatically submit form

#1

I am passing context data into a workflow. There is a step for gathering additional data (if the context does not contain it). I want to bypass or automatically submit the form if the form is valid.

In other words, if the context xml contains all of the information that in turn makes the form valid – I want to automatically move on to the next step in my workflow.

Thank you,
Jason

#2

Maybe something like:

	protected void Page_Load(object sender, EventArgs e)
{
    base.Page_Load(sender, e);
if(form.IsValid()){
form.Submit()
}
        SetPageProperties();
	}
#3

Hi @jason.smith ,

It’s better to validate everything in the condition of a transition.
If the condition is met, you can skip the unnecessary action and go directly to another action.

To answer your question, you can always use the function SubmitToWorkflow(); but it is highly recommended to change the logic of your workflow as mentioned above.

Regards,
Eddy.

1 Like