Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19
Like Tree1Likes

Thread: Overview of VarDefs

  1. #11
    malcolmh's Avatar
    malcolmh is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Aug 2004
    Posts
    1,712

    Default Re: Overview of VarDefs [CTO Series]

    We are looking to disable Standard Sugar fields in the reporting, importing, exporting and mail merge functions that we no using in a customer project.

    I can disable the value being shown in the reporting module by setting reportable=false. Is there no appropraite flag for the other options?

    I am not sure if there are depedencies if I delete the values not needed in vardefs.php
    Cheers Malcolm

    Genius4U Limited - Ingenious simple IT solutions for you / Genial einfache IT Lösungen für Sie
    http://www.genius4u.com or http://www.genius4u.de

  2. #12
    julian's Avatar
    julian is offline Sugar Team Member
    Join Date
    Sep 2004
    Posts
    1,639

    Default Re: Overview of VarDefs [CTO Series]

    Sugar should function fine without the vardefs present (it'll just ignore any extra fields).

    I'm not sure there are hooks in vardefs which control import/export-- that's something that may be worth adding. Maybe file a feature request at http://bugs.sugarcrm.com/?
    Julian Ostrow
    Systems and Applications Engineer
    SugarCRM Inc.

  3. #13
    sullivanjc is offline Sugar Community Member
    Join Date
    Mar 2006
    Posts
    11

    Angry Re: Overview of VarDefs [CTO Series]

    I'm trying to add a custom field (PriorityRank_c) to the Mass Update in the Accounts module. I have made changes to add a field to the fields array and a relationship between accounts and accounts_cstm (custom fields table) in the relationship array in modules/Accounts/vardefs.php. The field still does not show up in Mass Update. Are there other changes I need to make or am I doing something wrong? I'm working with 4.0.0beta

    Code:
    //This is in the fields array
    
       'PriorityRank_c' => 
      array (
        'name' => 'PriorityRank_c',
        'vname' => 'PriorityRank__c',
        'type' => 'relate',
        'table' => 'accounts_cstm',
        'len'=>15,
        'options' => 'company_priorityrank_dom',
        'dbtype' => 'enum',
        'massupdate' => true,    
        'rname' => 'PriorityRank_c',
        'id_name' => 'id',
      ),  
    
    
    //This is in the relationships array
    
    								
    	,'accounts_cstm' => array('lhs_module'=> 'Accounts', 'lhs_table'=> 'accounts', 'lhs_key' => 'id',
    							  'rhs_module'=> 'Accounts', 'rhs_table'=> 'accounts_cstm', 'rhs_key' => 'id_c',	
    							  'relationship_type'=>'one-to-one')

  4. #14
    wyred is offline Sugar Community Member
    Join Date
    Mar 2005
    Posts
    56

    Default Re: Overview of VarDefs [CTO Series]

    Quote Originally Posted by rliebscher
    Hi Jacob,

    great documentation!

    But i think u missed some field-types:

    • id
    • name
    • phone
    • email
    • text
    • link


    I think, it will also be good to show the semantic relations for some of these types, like:

    type = link, then u have to set source = non-db, relationship="name of relation", link_type, module and so on.
    type = phone | email, u have to set dbtype and len to configure db.

    I dont know all semantics this time. Maybe it is easy for you to explain.
    Or some other forum-user can document it and u extend this docu with there text.

    But again, thanks for this documentation

    Ronny
    Does field type id mean varchar(36)?

  5. #15
    Jacob's Avatar
    Jacob is offline Senior Member
    Join Date
    Oct 2004
    Posts
    331

    Default Re: Overview of VarDefs

    We are currently working on some enhancements to VarDefs.

    Once those are available we will be updating the documentation.

    Jacob

  6. #16
    cjohnston is offline Sugar Community Member
    Join Date
    Apr 2007
    Location
    Dover, NH
    Posts
    50

    Default Re: Overview of VarDefs

    Does this still hold true for Version 5? Very dice documentation although I don't have enough "under my belt" in the way of coding SugarCRM to identify the accuracy of this posting to the latest version.

  7. #17
    netron is offline Sugar Community Member
    Join Date
    Jan 2008
    Posts
    85

    Default Re: Overview of VarDefs

    using vardefs how would you extract and display a single record in a one-to-many relationship.

    for example, a lead would have many calls associated with it.

    how would you use a vardef to only extract the most recent call associated with a particular lead?

    the sql query for this is trivial:
    select date_modified from calls where parent_id='$lead_id' order by date_modified desc LIMIT 1

    it would be great to be able to do this entirely in vardefs without resorting to ugly mysql hacks in the code.
    Last edited by netron; 2008-02-01 at 02:04 PM.

  8. #18
    netron is offline Sugar Community Member
    Join Date
    Jan 2008
    Posts
    85

    Default Re: Overview of VarDefs

    in the vardefs of the leads module there's a relationships section in which there is this:

    'relationships' => array (

    ,'lead_calls' => array('lhs_module'=> 'Leads', 'lhs_table'=> 'leads', 'lhs_key' => 'id',
    'rhs_module'=> 'Calls', 'rhs_table'=> 'calls', 'rhs_key' => 'parent_id',
    'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
    'relationship_role_column_value'=>'Leads')


    this links a call to a lead, but how do you display a certain field in the call data, such as calls.date_modified?
    how is the sql statement that is built on vardefs actually built and how is its output rendered?

    looking at vardefs in isolation is all well and good, but what is the system architecture of sugar that routes vardef information to the browser. how is *that* constructed?

  9. #19
    SherryGui is offline Junior Member
    Join Date
    Feb 2008
    Posts
    1

    Default Re: Overview of VarDefs

    Quote Originally Posted by Jacob
    We are currently working on some enhancements to VarDefs.

    Once those are available we will be updating the documentation.

    Jacob
    Hi Jacob,

    Have you updated documentation for vardefs.php? I am having difficulty to figure out how to use "link" to refer a field from another table.

    Thanks,
    Sherry

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

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

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
  •