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:
- 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:
- Fecha (date field)--> needs to be updated with current date
- Fecha de validez(date field) --> needs to be updated with current date + 2 days
- Asunto (single line field) --> needs to be updated with the same value as the autonumber field called "NÂș Oportunidad" in deals/potential module
- IVA (list field)--> needs to be updated depending on a field in deals module called IVA.
- If IVA (in deals module) = 0 --> then IVA (in sales order module) is "Exento"
- If IVA (in deals module) = 10 --> then IVA (in sales order module) is "10%"
- If IVA (in deals module) = 21 --> then IVA (in sales order module) is "21%"
Thank you