Results 1 to 7 of 7

Thread: auto fill subpanel fields, Need Help

  1. #1
    blitz2190 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    105

    Default auto fill subpanel fields, Need Help

    i have created a custom module with a one-to-many relationship from cases to custom module named dev request. The case field auto populates which is good. Now i want to be able to do the same with two other fields in those modules
    ex.
    to go from cases to dev request
    PHP Code:
    products_c => products_c (these are dropdowns)
    version_c => version_c (these are text fields
    any ideas?
    -thank you

  2. #2
    blitz2190 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    105

    Default Re: auto fill subpanel fields, Need Help

    ok iv narrowed it own to adding this to vardefs

    PHP Code:
    <?php
    // created: 2010-01-07 10:29:12
    $dictionary["ad21_Dev_Request"]["fields"]["product_c_link"] = array (
      
    'name' => 'product_c_link',
      
    'type' => 'link',
      
    'relationship' => 'cases_ad21_dev_request_c',
      
    'source' => 'non-db',
      
    'side' => 'right',
      
    'vname' => 'LBL_CASES_AD21_DEV_REQUEST_FROM_CASES_PRODUCT',
    );
    ?>
    <?php
    // created: 2010-01-07 10:29:12
    $dictionary["ad21_Dev_Request"]["fields"]["product"] = array (
      
    'name' => 'product',
      
    'type' => 'relate',
      
    'source' => 'non-db',
      
    'vname' => 'LBL_CASES_AD21_DEV_REQUEST_FROM_CASES_PRODUCT',
      
    'save' => true,
      
    'id_name' => 'cases_ad21e427stcases_ida',
      
    'link' => 'product_c_link',
      
    'table' => 'cases',
      
    'module' => 'Cases',
      
    'rname' => 'name',
    );
    ?>
    but how would i change this to pull the products_c field from cases instead of the name of the case

  3. #3
    blitz2190 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    105

    Default Re: auto fill subpanel fields, Need Help

    i know this post is old but i still need to be able to do this anyone know how?

  4. #4
    blitz2190 is offline Senior Member
    Join Date
    Jul 2009
    Posts
    105

    Default Re: auto fill subpanel fields, Need Help

    i have the same problem still, now i have a custom module called dev request, that is a subpanel of cases, when i create one it pulls the case name, but i need it to also pull the account name from the case, there will always be an account name in the case that a dev request is made from so i can use parent id but i d not now how i would do this

  5. #5
    hoangbao is offline Sugar Community Member
    Join Date
    Aug 2007
    Location
    Saigon - Vietnam
    Posts
    76

    Default Re: auto fill subpanel fields, Need Help

    Quote Originally Posted by blitz2190 View Post
    ok iv narrowed it own to adding this to vardefs

    PHP Code:
    <?php
    // created: 2010-01-07 10:29:12
    $dictionary["ad21_Dev_Request"]["fields"]["product_c_link"] = array (
      
    'name' => 'product_c_link',
      
    'type' => 'link',
      
    'relationship' => 'cases_ad21_dev_request_c',
      
    'source' => 'non-db',
      
    'side' => 'right',
      
    'vname' => 'LBL_CASES_AD21_DEV_REQUEST_FROM_CASES_PRODUCT',
    );
    ?>
    <?php
    // created: 2010-01-07 10:29:12
    $dictionary["ad21_Dev_Request"]["fields"]["product"] = array (
      
    'name' => 'product',
      
    'type' => 'relate',
      
    'source' => 'non-db',
      
    'vname' => 'LBL_CASES_AD21_DEV_REQUEST_FROM_CASES_PRODUCT',
      
    'save' => true,
      
    'id_name' => 'cases_ad21e427stcases_ida',
      
    'link' => 'product_c_link',
      
    'table' => 'cases',
      
    'module' => 'Cases',
      
    'rname' => 'name',
    );
    ?>
    but how would i change this to pull the products_c field from cases instead of the name of the case
    Hi blitz2190,

    replace

    PHP Code:
    'rname' 'products_c'
    regards,
    hoangbao

  6. #6
    layman99's Avatar
    layman99 is offline Senior Member
    Join Date
    Jan 2011
    Location
    Shimla
    Posts
    82

    Wink Re: auto fill subpanel fields, Need Help

    no need to do so much stuff just edit the following file...

    sugarcrm\include\generic\SugarWidgets\SugarWidgetS ubPanelTopButtonQuickCreate.php
    add the code like this any where after these lines of code ....

    if(!empty($defines['view']))
    $button .= '<input type="hidden" name="target_view" value="'. $defines['view'] . '" />';
    $button .= '<input type="hidden" name="to_pdf" value="true" />';
    $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />';
    $button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n";
    $button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n";
    $button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n";
    $button .= '<input type="hidden" name="return_relationship" value="' . $relationship_name . "\" />\n";


    __________________________
    Add these lines of code after these lines of code --Add as many field as u want to autofill in subpanel

    if(!empty($additionalFormFields['parent_id']))
    {
    if($defines['child_module_name'] == "subpanelmodulename"){
    $additionalFormFields['subpanelmodulefieldname in studio'] = $defines['focus']->mainmodulefieldname in studio;
    $additionalFormFields[''subpanelmodulefieldname in database'] = $defines['focus']->'mainmodulefieldname in database;
    }
    else {
    $additionalFormFields['parent_id'] = $defines['focus']->id;
    }
    }
    +++++++++++++++++++++++
    If it will not run let me know................
    Best of luck
    Cheers....
    Dinesh Joshi
    sugarcrm CE 6.1.0
    joshishimla99@gmail.com

  7. #7
    nilpaul is offline Sugar Community Member
    Join Date
    Apr 2011
    Posts
    14

    Default Re: auto fill subpanel fields, Need Help

    Is this solution worked. I have tried with version 6.1 but did not work for me, any ideas??? Thanks..

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 12
    Last Post: 2011-07-12, 10:54 AM
  2. Auto-fill date field on create
    By datasponge in forum Developer Help
    Replies: 2
    Last Post: 2009-12-11, 04:23 AM
  3. Replies: 4
    Last Post: 2009-08-24, 05:22 PM
  4. email auto fill
    By afsugaruser in forum Help
    Replies: 0
    Last Post: 2009-07-15, 04:53 PM
  5. Auto-fill field with filtering
    By prajeesh in forum Help
    Replies: 1
    Last Post: 2009-07-06, 01:38 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
  •