Results 1 to 3 of 3

Thread: Getting Projektnumber after selecting Project in a related field?

  1. #1
    fabivomsee is offline Sugar Community Member
    Join Date
    May 2007
    Posts
    78

    Question Getting Projektnumber after selecting Project in a related field?

    Version 5.2.0a (Build 5447)
    Is there a Solution to get the Information of a Project, when it is selected in a related field from another module.
    For Example:
    In a Module based on contacts, called Projectmanagers, I select the project via a related field. Now how do I get more Information into the Module "Projectmanagers" like Project number, or anything else..

    Thank you for your replies.

  2. #2
    letrium is offline Sugar Community Member
    Join Date
    Dec 2008
    Posts
    614

    Smile Re: Getting Projektnumber after selecting Project in a related field?

    Hi!

    You may write similar function as set_return in "include/javascript/sugar_grp1.js"
    where you should use ajax function to get any data you need.

    like this:

    Code:
    function r_set_return(popup_reply_data){
      from_popup_return=true;
      var form_name=popup_reply_data.form_name;
      var name_to_value_array=popup_reply_data.name_to_value_array;
      for(var the_key in name_to_value_array){
        if(the_key=='toJSON'){}else{
          var displayValue=name_to_value_array[the_key].replace(/&amp;/gi,'&').replace(/&lt;/gi,'<').replace(/&gt;/gi,'>').replace(/'/gi,'\'').replace(/&quot;/gi,'"');;
          window.document.forms[form_name].elements[the_key].value = displayValue;
          }
      }
    
      doWork(); <- there we should use ajax
    
    }
    and set custom code for popup in editviewdefs:
    Code:
     onclick=\'open_popup("teams_teams", 600, 400, "", true, false, {literal}{{/literal}"call_back_function":"r_set_return","form_name":"EditView","field_to_name_array":{literal}{{/literal}"id":"team_id","name":"team_name"{literal}}{/literal}{literal}}{/literal}, "single", true);\'

  3. #3
    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: Getting Projektnumber after selecting Project in a related field?

    Add a displayParams attribute like that in the related field:

    PHP Code:
                'displayParams' =>
                array (
                  
    'field_to_name_array' => array(
                    
    'id' => 'accounts_tenyaccounts_ida',
                    
    'name' => 'accounts_test_company_name',
                    
    'billing_address_street' => 'billing_address_street',
                    
    'billing_address_city' => 'billing_address_city',
                    
    'billing_address_state' => 'billing_address_state',
                    
    'billing_address_country' => 'billing_address_country',
                    
    'billing_address_postalcode' => 'billing_address_postalcode',
                    
    'website' => 'website',
                    
    'phone_office' => 'phone_office',
                    
    'phone_fax' => 'phone_fax',
                    
    'phone_alternate' => 'phone_alternate',
                    
    'employees' => 'employees',
                    
    'annual_revenue' => 'annual_revenue',
                    
    'industry' => 'industry',
                    
    'account_type' => 'account_type',
                  ),
                ), 
    Cheers
    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. disabling selecting another user for assigned to field
    By hermawan in forum Developer Help
    Replies: 3
    Last Post: 2008-10-08, 04:30 AM
  2. Can I create a Note "related to" Project AND "related to" contact
    By marcuscake in forum General Discussion
    Replies: 1
    Last Post: 2008-09-15, 11:40 PM
  3. Project Advance Search Related to field v5GA
    By JeanetteRoss in forum Help
    Replies: 0
    Last Post: 2007-12-18, 02:01 PM
  4. Auto Assign TO field after selecting Contact
    By kenlyle in forum Feature Requests
    Replies: 0
    Last Post: 2007-03-06, 01:20 PM
  5. Task "related to" project, but now showing with project
    By jjcmoney in forum General Discussion
    Replies: 6
    Last Post: 2006-02-03, 11:19 AM

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
  •