Results 1 to 4 of 4

Thread: Calculations

  1. #1
    henryvho is offline Junior Member
    Join Date
    Feb 2011
    Posts
    2

    Default Calculations

    Hi,

    I have several interger and decimal in the contacts tab.

    Fields such as current_balance and available_balance. Both are in decimal.

    Is there a way I can create a new field called "balance_ratio" in SugarCRM which automatically divides the two fields current_balance/available_balance and show the percentage on a "ListView" layout?

    I sincerely appreciate your support. Sugar is AWESOME!!!

    Thanks,
    Henry

  2. #2
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Calculations

    Hello,

    If you want such kind of facility in ListView ONLY,then
    1) Create a non-db field by extending vardefs.
    2) Create a logic_hook (process_record) and assign a value to it.


    If you want to create a custom field then
    1) Save value in before_save logic_hook,
    2) Put it in listview via studio.
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

  3. #3
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: Calculations

    In Sugar Professional and Sugar Enterprise, we now have since Sugar 6.2 a new "Calculated Field" attribute on the field inside of Studio that allows you to easily write the expression that you just described. What henryvho is also absolutely correct and will work in all editions of Sugar. This new Calculated Field mechanism simplifies this process for Pro and Enterprise users.
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  4. #4
    item is offline Sugar Community Member
    Join Date
    Oct 2010
    Location
    BELGIUM
    Posts
    193

    Default Re: Calculations

    Quote Originally Posted by clint View Post
    In Sugar Professional and Sugar Enterprise, we now have since Sugar 6.2 a new "Calculated Field" ...This new Calculated Field mechanism simplifies this process for Pro and Enterprise users.
    Hi Clint,
    Happy to know that a new type of field is born for sugarcrm 6.2 "PRO" and "ENT"
    god save this field type and sorry for CE

    Regards.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calculations in reports
    By REByers in forum Help
    Replies: 5
    Last Post: 2010-03-01, 04:22 AM
  2. How to add calculations to a module
    By vanrechemh in forum Help
    Replies: 4
    Last Post: 2009-10-20, 08:49 AM
  3. Calculations
    By monicaDC in forum Developer Help
    Replies: 11
    Last Post: 2009-05-13, 05:57 AM
  4. Mathematical calculations
    By danrweki in forum Developer Help
    Replies: 2
    Last Post: 2008-08-05, 07:58 AM
  5. Help with Calculations
    By JackieBM in forum Help
    Replies: 0
    Last Post: 2007-02-21, 06:13 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •