Generate automatically Sales Orders when deal changes status

Generate automatically Sales Orders when deal changes status

Hello,

I need a function to automatically generate sales orders when I change the stage of the deals/potentials.

I have to create a workflow rule:
  1. When deal/potential stage changes to "Pedido", then activates a function to automatically generate a new sales order record mapped to that potential/deal.

In the new Sales Order record, I have some mandatory fields I need to update as follows:
  1. Fecha (date field)--> needs to be updated with current date
  2. Fecha de validez(date field) --> needs to be updated with current date + 2 days
  3. Asunto (single line field) --> needs to be updated with the same value as the autonumber field called "NÂș Oportunidad" in deals/potential module
  4. IVA (list field)--> needs to be updated depending on a field in deals module called IVA.
    1. If IVA (in deals module) = 0 --> then IVA (in sales order module) is "Exento"
    2. If IVA (in deals module) = 10 --> then IVA (in sales order module) is "10%"
    3. If IVA (in deals module) = 21 --> then IVA (in sales order module) is "21%"

Thank you