Whats the value behind $annual_revenue

Hey community :-) I would like to display the annual revenue in the accounts module.

Expectation: use $annual_revenue in a calculated field to get a rollup sum of opportunities closed won in the appropriate timerange

Instead: It's always 0, tested different field formats (text, float, currency, with and without number and string formula.

I know we kind of mistreated the revenue fields in the opportunities-module, so I'm guessing $annual_revenue is adressing data that is not populated at all.

So please help, what's the magic behind the annual revenue?

  • Hi ,

    Can you share what your current Sugar Logic formula is for rolling up the annual revenue? You mention that you want to rollup closed won opportunities, but the Opportunities module does not have an annual revenue field. Annual revenue exists on the Purchased Line Items module and you should be able to get a rollup of that field. I recommend the target field on your Accounts module to be a currency field since Annual Revenue is also a currency field. 

    The documentation of the Purchased Line Items module goes into greater detail as to how Annual Revenue is calculated for each record.


  • Thanks for your answer. I was just trying to display the content in annual_revenue in the accounts module. I was expecting it to be a rollup from matching opportunites, but as you are stating that value comes from purchased line items, which we're not using at all. 

    So i have to stick to my old way which goes like "check if opportunity is closed won within last 365 days, if yes save the revenue into a custom field, if no save 0. in accoounts module rollupsum all "valid" revenues accordingly." problem here is that the field values in the opportunities dont update themselves. so i need to trigger some kind of recalculation every now and then :(

  • Hi ,

    One potential solution you could implement is a process definition in SugarBPM like the following:

    The process can be described based on the following:

    1. Starts when an opportunity is changed to 'Closed Won'
    2. Immediately updates a custom field on the opportunity tracking whether the deal was won in the last 12 months. Your conditional rollup calculation on the account record would be based on this field and this update in the process should automatically trigger a recalculation.
    3. Then we use an event-based gateway to listen for the first event to occur:
      1. 1 year elapses (I chose 1 year from the expected closed date but you could also do 1 year from the point the opportunity changes to closed won)
      2. The opportunity is reverted out of a closed won state (whether due to error or some other business reason).
    4. Regardless of which event happens, we want the resulting action to change the custom field tracking business won in the last 12 months. This update should again cause a recalculation for the account.

    I normally do not recommend using wait events for such an extended amount of time because it can cause potential performance issues when there are a high volume of transactions to hold in the waiting queue. Opportunities may be a suitable use case though depending on how many opportunities you expect to be queued for a year at any given time (i.e. how many total opportunities are typically won in a 12-month timeframe). If that number is in the 100s then this solution should be okay, but if you are closing opportunities in the 1000s, a custom scheduled job would likely be a better solution for handling this business case.

    One additional note is that the above process definition would only work for opportunities changing to 'Closed Won' moving forward. You would need to manually adjust the custom value for existing opportunities until they age out over the next 12 months. That maintenance can be performed via mass update in the list view.