Results 1 to 2 of 2

Thread: IFrame field not setting some fields

  1. #1
    Thyssen is offline Sugar Community Member
    Join Date
    Oct 2007
    Posts
    38

    Default IFrame field not setting some fields

    I was trying to do something that seemed simple but doesn't seem to be working.
    What I wanted to do is for the accounts module to display a map (google map) of the accounts address.
    Simple I thought I'd just create an iFrame field type, set the size to 200 and in the default value I placed this:

    http://maps.google.com/maps?f=q&q={shipping_address_street}+{shipping_add ress_city}+{shipping_address_state}+{shipping_addr ess_postalcode}+{shipping_address_country}&source= embed&output=embed

    But everytime I create a new account and view it in detail view I see the map however the map is pointing to SugarCRM offices??? Even though the shipping address is something I have entered.

    Anyone with any ideas on this would be very much appreciated.

  2. #2
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: IFrame field not setting some fields

    If you open cache/modules/Accounts/DetailView.tpl is the address hardcoded in there? If so, that may be the issue. You may need to instead overwrite the detail view and insert the variables that way.

    Maybe something like the following (not tested):
    custom/modules/Accounts/views/view.detail.php:
    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');


    require_once(
    'include/MVC/View/views/view.detail.php');

    class 
    AccountsViewDetail extends ViewDetail {

         function 
    AccountsViewDetail(){
             
    parent::ViewDetail();
         }
         
         function 
    display() {
         
            
    $map_url "http://maps.google.com/maps?f=q&q=".$this->bean->shipping_address_street."+".$this->bean->shipping_add ress_city."+".$this->bean->shipping_address_state."+".$this->bean->shipping_addr ess_postalcode."+".$this->bean->shipping_address_country."&source= embed&output=embed";
            
    $this->ss->assign("MAP_URL"$map_url);
        
             
    parent::display();
         }
    }
    ?>
    custom/modules/Accounts/metadata/detailviewdefs.php:
    PHP Code:
    ......src="{$MAP_URL}".... 
    That should make the data dynamic.

    Hope that helps,
    Jason

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. IFrame type field issues
    By yxiao in forum Feature Requests
    Replies: 0
    Last Post: 2009-06-23, 10:11 PM
  2. Setting custom fields values.
    By jssenyange in forum Developer Help
    Replies: 2
    Last Post: 2009-01-31, 04:53 PM
  3. setting a field value dependent to another field
    By ecomplexx in forum Developer Help
    Replies: 2
    Last Post: 2009-01-30, 10:29 AM
  4. Replies: 0
    Last Post: 2008-10-01, 02:30 AM
  5. custom Fields & Setting value on the Fly
    By cpscdave in forum Help
    Replies: 1
    Last Post: 2007-06-26, 06:07 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
  •