Results 1 to 6 of 6

Thread: build a field that contains the union of two fields.

  1. #1
    peppolax is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    56

    Default build a field that contains the union of two fields.

    Hi,

    I want to build a field that contains the union of two fields.
    For ex. (Fullname contains Firstname and Lastname).
    How can i do this?

    thanks

  2. #2
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: build a field that contains the union of two fields.

    Hi

    Use this

    PHP Code:


    'first_name' =>
            array (
                
    'name' => 'first_name',
                
    'vname' => 'LBL_FIRST_NAME',
                
    'type' => 'varchar',
                
    'len' => '100',
                
    'unified_search' => true,
                
    'comment' => 'First name of the contact',
                
    'merge_filter' => 'selected',     
                
            ),


    'last_name' =>
            array (
                
    'name' => 'last_name',
                
    'vname' => 'LBL_LAST_NAME',
                
    'type' => 'varchar',
                
    'len' => '100',
                
    'unified_search' => true
                
    'comment' => 'Last name of the contact',
                
    'merge_filter' => 'selected',
                
    'importable' => 'required',
            ),


        
    'full_name' =>
            array (
                
    'name' => 'full_name',
                
    'rname' => 'full_name',
                
    'vname' => 'LBL_NAME',
                
    'type' => 'name',
                
    'fields' => array('first_name''last_name'),
                
    'sort_on' => 'last_name',
                
    'source' => 'non-db',
                
    'group'=>'last_name',
                
    'len' => '510',
                
    'db_concat_fields'=> array(0=>'first_name'1=>'last_name'),
            ), 
    Letrium ltd. - Only high quality service
    http://letrium.com

  3. #3
    peppolax is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    56

    Default Re: build a field that contains the union of two fields.

    thanks for your replay.
    a question,
    where i can custom this file?
    I use modules contacts e i want to see this field in detailview.

  4. #4
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: build a field that contains the union of two fields.

    Quote Originally Posted by peppolax View Post
    thanks for your replay.
    a question,
    where i can custom this file?
    I use modules contacts e i want to see this field in detailview.
    So, you don't need that code if you are using contact module

    Just edit a file ../modules/Contacts/metadata/detailviewdefs.php
    And then rebuild templates.

    PHP Code:

    'panels' =>array (
       
    'default'=>array(
    ...

    array (
    'full_name'),

    ....
    ), 
    Letrium ltd. - Only high quality service
    http://letrium.com

  5. #5
    peppolax is offline Sugar Community Member
    Join Date
    Jan 2010
    Posts
    56

    Default Re: build a field that contains the union of two fields.

    thank you so much
    i have resolt.

    I have another question,...
    if i want custom the layout, the name up the last name, not all in a single line
    for ex.
    First name
    Lastname

    how i can do???

    Thaks

  6. #6
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: build a field that contains the union of two fields.

    Quote Originally Posted by peppolax View Post
    thank you so much
    i have resolt.

    I have another question,...
    if i want custom the layout, the name up the last name, not all in a single line
    for ex.
    First name
    Lastname

    how i can do???

    Thaks
    It is simple to do.

    PHP Code:

    'panels' =>array (
       
    'default'=>array(
    ...

    array (
    'first_name'),
    array (
    'last_name'),
    ....
    ), 
    Letrium ltd. - Only high quality service
    http://letrium.com

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. UNION in create_list_query()
    By dblake in forum Developer Help
    Replies: 12
    Last Post: 2008-03-31, 12:09 PM
  2. Replies: 0
    Last Post: 2008-01-25, 02:33 PM
  3. Zucker sql union error
    By hawkpig in forum Help
    Replies: 1
    Last Post: 2007-11-30, 04:00 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
  •