Results 1 to 4 of 4

Thread: Help with calculated fields - creating a record id based on related lookup and date

  1. #1
    kirstyobrien's Avatar
    kirstyobrien is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Denver, CO
    Posts
    32

    Post Help with calculated fields - creating a record id based on related lookup and date

    Sugar Version: 6.2
    Sugar Edition: Enterprise On Demand
    Category: Opportunities
    Operating System: Windows 7


    Good afternoon, I am trying to create a calculated field on opportunity module to create an internal ID for our opportunities. We are looking for the format "lookup account name on opportunitiy"-"todays date". Once created it cannot changed.

    I cant find account name in the field lookup in formula builder and cannot get the format of the formula right to put two of any field together.

    Any help would be appreciated.

    Thanks

  2. #2
    Editha is offline Sugar Community Member
    Join Date
    Feb 2008
    Posts
    58

    Default Re: Help with calculated fields - creating a record id based on related lookup and da

    The account_name field cannot be used in a calculated field. In the studio/Formula Editor $account_name is not available and if you try the following field definition for a calculated field with name 'internal_id'

    <?php
    $dictionary['Opportunity']['fields']['internal_id'] =
    array (
    'name' => 'internal_id',
    'type' => 'varchar',
    'calculated' => true,
    'formula' => '$account_name',
    );
    ?>
    you'll see, that it doesn't work properly.
    If you select an account from the popup window there is no event 'onchange' on the account_name field.

    I would calculate the field in a logic hook

  3. #3
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Help with calculated fields - creating a record id based on related lookup and da

    It can be performed creating a custom field and assign its value programatically.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  4. #4
    kirstyobrien's Avatar
    kirstyobrien is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Denver, CO
    Posts
    32

    Default Re: Help with calculated fields - creating a record id based on related lookup and da

    Thanks, I am on the on-demand version so cant do any coding.

    Rafael, can you please let me know how to programatically assign a value using a custom field - what field type etc do I select?

    Thanks again!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. related account type lookup in contact record
    By Sunnsky in forum General Discussion
    Replies: 1
    Last Post: 2010-05-07, 04:57 AM
  2. Creating Fields - calculated fields and 'related' field
    By gipps in forum General Discussion
    Replies: 0
    Last Post: 2007-07-21, 10:17 PM
  3. Replies: 0
    Last Post: 2006-11-20, 05:05 PM

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
  •