Results 1 to 5 of 5

Thread: Problema na ListView com campo RELATE

  1. #1
    leochaves is offline Sugar Community Member
    Join Date
    Feb 2011
    Posts
    10

    Default Problema na ListView com campo RELATE

    Preciso de ajuda.

    Criei um relacionamento one-to-many entre 2 novos módulos.
    Estou com problemas na ListView pois ela teima em não mostrar o campo que eu coloquei no 'rname'.

    PHP Code:
    // vardefs.php

      
    $dictionary['paci_pacientes_insercao']['fields']['paciente_nome'] => 
      array (
        
    'required' => false,
        
    'source' => 'non-db',
        
    'name' => 'paciente_nome',
        
    'vname' => 'LBL_PACIENTE_NOME',
        
    'type' => 'relate',
        
    'massupdate' => 0,    
        
    'importable' => 'true',
        
    'duplicate_merge' => 'disabled',
        
    'duplicate_merge_dom_value' => '',
        
    'audited' => true,
        
    'reportable' => true,    
        
    'id_name' => 'paciente_id',
        
    'ext2' => 'paci_Pacientes'//????
        
    'module' => 'paci_Pacientes',
        
    'rname' => 'nome',
        
    'quicksearch' => 'enabled',
        
    'link' => false,
      ), 
    detailview e editview funcionam muito bem porém o listview insiste em não usar o campo certo.

    DEBUG ligado:

    SELECT paci_pacientes_insercao.id , jt0.name paciente_nome , paci_pacientes_insercao.status , paci_pacientes_insercao.motivo , paci_pacientes_insercao.data_inicio , paci_pacientes_insercao.data_final , paci_pacientes_insercao.assigned_user_id FROM paci_pacientes_insercao LEFT JOIN paci_pacientes jt0 ON paci_pacientes_insercao.paciente_id = jt0.id AND jt0.deleted=0 where paci_pacientes_insercao.deleted=0 ORDER BY paci_pacientes_insercao.data_inicio ASC
    Não consigo descobrir de onde ele tira que o campo paciente_nome esta relacionado com name

    Código do listviewdefs
    PHP Code:
    $listViewDefs [$module_name] ['paciente_nome'] => 
      array (
        
    'type' => 'relate',
        
    'default' => true,
        
    'sortable' => true,
        
    'width' => '10%'
        
    'label' => 'LBL_PACIENTE_NOME',
      ), 
    -----------------------------
    Usando a versão comunity 6.1

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Problema na ListView com campo RELATE

    Está faltando o atributo 'link' que vai definir o join para recuperar o nome e também poder ordenar pelo nome.
    Dê uma olhada na definição do campo 'account_name' em Cases.

    Att
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    leochaves is offline Sugar Community Member
    Join Date
    Feb 2011
    Posts
    10

    Default Re: Problema na ListView com campo RELATE

    A dica foi boa obrigado.

    Agora estou estou com outro problema. O link (html) que aparece no nome aponta pro módulo certo porém ele pede para abir o registro errado, o id que esta sendo passado é o do registro que tem a referencia e não o id referenciado.

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Problema na ListView com campo RELATE

    Checa em modules/Cases/metadata/listviewdefs.php como ele trata o id da conta para a referencia correta.

    Att
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  5. #5
    leochaves is offline Sugar Community Member
    Join Date
    Feb 2011
    Posts
    10

    Default Re: Problema na ListView com campo RELATE

    Só para finalizar a thread.

    O módulo Case foi de muita utilidade. Obrigado pela dica.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Problema campo fecha
    By rargueta in forum Español
    Replies: 0
    Last Post: 2010-08-13, 06:41 PM
  2. Problema con flex relate... AYUDA
    By Al3x4 in forum Español
    Replies: 0
    Last Post: 2010-03-08, 05:53 PM
  3. Campo Relate
    By jorgeluiz in forum Portugese
    Replies: 2
    Last Post: 2008-11-10, 06:03 PM
  4. Campo Relate NULL
    By marco81 in forum Italiano
    Replies: 0
    Last Post: 2007-12-27, 02:25 PM
  5. Problema para insertar campo en Studio
    By carlosx in forum Español
    Replies: 1
    Last Post: 2007-08-20, 11:59 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
  •