How to create new workflow instance from X++

Hi everyone,

We have a piece requirement that asks for a new workflow instance being created from X++ programming. For instance, we add a new ribbon button that can create a new sales order workflow instance for the selected sales order. Anyone knows a good piece of example code?

Thank you!

The workflow instance will be created, when submitted to workflow. Do you need code to submit a workflow? If not please elaborate.

Hi Kranthi, thank you for the reply, actually, I was led to a place somewhat not accurate. I know with the code piece submitting to workflow. But initially the requirement was talking about something else, I found another way to address it. No further help is needed. Thanks!