Announcement

Collapse
No announcement yet.

Updating of the lead's status according to the most recent opportunity

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Updating of the lead's status according to the most recent opportunity

    Hello,

    I have a dilemma that I will try to explain to you.

    In my context, my clients are customers of my company for several years because I sell annual subscriptions. Thus, each lead or contact is linked to several opportunities because there is one opportunity per year.

    In my system, each opportunity has a status (project, current purchase, sale, expired).
    My leads and contacts also have a status (not yet a customer, in the process of buying, current or former customer).

    I would like my lead's status to change depending on the status of the most recent opportunity. When I create or update an opportunity, I would like the lead's status to be updated.
    If each client was linked to only one opportunity, I could do it through a workflow, but there, each client is linked to several opportunities and it must be the status of the most recent one that is the reference.

    Would anyone know how to help me?

    Perhaps it is possible to retrieve the id of the last opportunity and read information... I'm a little confused.

    Thank you

  • #2
    Hello.
    There are few ways how to do this.

    1. The most recent opportunity in general is the last updated, so you could use workflow. If not, you can create an additional relation, and store last opportunity, and use this opportunity in workflow
    2. You can create a hook https://github.com/espocrm/documenta...pment/hooks.md

    Comment

    Working...
    X