Results 1 to 4 of 4

Thread: How can I retrieve other module's field into opportunities module?

  1. #1
    manfree's Avatar
    manfree is offline Senior Member
    Join Date
    Sep 2009
    Posts
    29

    Default How can I retrieve other module's field into opportunities module?

    Hi all,

    How can I retrieve other module's field into opportunities module ??

    For example,
    i have a custom module "Product", it includes the "product name" and "product price" field
    Then, I am going to create new opportunity,
    after I have selected the product, this new opportunity record is able to retrieve the product price as well ~

    I don't mind the product price can be retrieved after I clicked the "Save" button in opportunity

    Any body could help ??
    Thanks

    Sam

  2. #2
    salesagility's Avatar
    salesagility is offline Sugar Community Member
    Join Date
    Aug 2006
    Location
    UK
    Posts
    2,379

    Default Re: How can I retrieve other module's field into opportunities module?

    You cannot do this using native SugarCRM Studio functionality and will need to cut some custom code. It's not too difficult.

  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: How can I retrieve other module's field into opportunities module?

    You need to do the following:
    1. Create the product_price field through Studio;
    2. Add this field into both detailview and editview through studio;
    3. Create a logic_hook before_save where you will save into product_price custom field the value from related product.


    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.

  4. #4
    manfree's Avatar
    manfree is offline Senior Member
    Join Date
    Sep 2009
    Posts
    29

    Default Re: How can I retrieve other module's field into opportunities module?

    I read the document about "Custom Bean Files"

    it has a function:

    PHP Code:
    function save($check_notify FALSE) {
        global 
    $current_user;
        
    $this->description .= "\nSaved on ".date("Y-m-d g:i a"). " by " .$current_user->user_name;
        
    parent::save($check_notify);

    the above function can update the description in the same module,


    Does it mean I have to do the same thing in opportunity form?
    for example,

    < after the user clicked the "SAVE" button in opportunity form >

    PHP Code:
    function save($check_notify FALSE) {
        
    $this->product_price = ??????;
        
    parent::save($check_notify);

    But ....
    1. How can I retrieve other module's value ("price" in Products module) and put into opportunity module?
    2. Where should I put / insert this script?
    Thanks

    Sam

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 2008-11-14, 09:11 AM
  2. Searching by related module's field
    By dusker in forum Developer Help
    Replies: 1
    Last Post: 2008-11-12, 02:28 PM
  3. Replies: 0
    Last Post: 2008-10-22, 10:51 AM
  4. Replies: 0
    Last Post: 2006-10-27, 10:57 PM
  5. Task activities linking with another module's date field
    By kevinjj33 in forum Developer Help
    Replies: 1
    Last Post: 2006-01-04, 09:45 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
  •