Deluge Code to Convert Quotes to Sales Order

Deluge Code to Convert Quotes to Sales Order

Hello community,

I need a Deluge code to convert (not create a new one, but convert) a Quote to Sales Order.
I want to use Workflows, so when Quote hits a stage Accepted it will run and convert Sales Order.

I would be extremely grateful if you can also tell me how to change the code to add more fields mapping, so I can map our custom fields.

Thank you so much for your time and support!
Ivan