Workflow

How to Create and Delete a CRM Business Opportunity

Verified end to end. A disposable CRM business opportunity was created, opened on its detail page, verified in the opportunity list, deleted, and verified absent after cleanup.

Evidence Summary

Workflow run
crm-opportunity-create-delete-20260519T122337Z
Opportunity code
2605-0001
Description
AI Demo CRM Opportunity 20260519T122337Z
Associated entity
Customer 910
Final state
No matching row returned by DT_ListaOportNeg

CRM business opportunity create/delete workflow diagram

Create the Opportunity

  1. Open /crm/oportunidadesnegocios.
  2. Click New Business Opportunity.
  3. Fill Description, Step, Ending Estimated Date, Assign to, Commercial, Value Estimate, and Probability Sale.
  4. Choose a third-party type, then select the customer, supplier, or prospect.
  5. Set a source such as Outros when the opportunity does not come from a campaign, mailing, or contact.
  6. Click Save.

The verified save used POST /ajaxserver with action=gravaOporNeg, TipoTerc=C, CodTerc=910, Designacao=AI Demo CRM Opportunity 20260519T122337Z, CodFaseCV=SG, DataFechoPrev=19/06/2026, CodEmpr=1, CodVend=1, AreaNegocio=3, ValorEstimado=1234.56, ProbabilVenda=25, and CodOrigemOport=O. The response returned {"success":true} with data.CodOportNeg=2605-0001.

Verify the Created Record

After saving, OfficeGest opens the detail route with the opportunity code encoded in base64, for example /crm/oportunidadesnegocios/view/MjYwNS0wMDAx. The verified detail page showed the created description and opportunity data.

The list verification used DT_ListaOportNeg with open-opportunity filters search[Op.CodEmpr]=1 and search[Op.Concluido_c]=F, plus a description column search. The response returned the new row with code 2605-0001.

Delete the Opportunity

  1. Find the opportunity in /crm/oportunidadesnegocios.
  2. Use the row delete action.
  3. Confirm the delete dialog.

The verified delete used POST /ajaxserver with action=deleteAttachmentCascade, tabela=oportneg, search[CodOportNeg]=2605-0001, and searchAt[CodOportNeg]=2605-0001. The endpoint returned {"succeeded":true}, and the next DT_ListaOportNeg lookup returned no matching row.

Artifacts