Calculated fields with clauses

I am setting up sugarCRM for a real estate administration company..

I have used the accounts module for buildings and apartments..
Each apartment is a member of the building they are in..

I have made a calculated field (count($members)) to show how many apartments fall under one building.. (this works)

Each apartment has a status field (dropdown) that is either 'Rented' or 'Available', I would like to count how many apartments are rented in each building.

In SQL it would look something like this:
SELECT *
FROM Building1
WHERE status = 'Rented'

How do I make this in sugar?

Parents Reply
  • Hi Patrick McQueen,

    I tried this already with the account_type list in SugarCRM Enterprise 8.3.0 (demo environment)

    When I replace the field name with the variable it seems to accept this but 'Customer' is an issue in any combination (looks like lists are not working here:

    With "array()"

    Without "array()"

    Next try with double quotes the formula is accepted

    but ends in an error 500 on opening accounts

    With "array()" and double quotes

    Looks like we have a bug here or formulas with dropdowns doesn't work.

    Any idea or should we raise a bug report?

    Bests

    Björn

Children