Results 1 to 3 of 3

Thread: How to open a popup within a logic hook?

  1. #1
    fedepia is offline Sugar Community Member
    Join Date
    Aug 2007
    Location
    Rosario, Argentina
    Posts
    104

    Question How to open a popup within a logic hook?

    Hello, I need to open a popup before a save an opportunity.
    I have created the logic_hooks.php file in custom/modules/Opportunities and its content is
    PHP Code:
    if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    $hook_array = array();
    $hook_array['before_save'] = array();

    // array(hook execute order, 'hook name', 'hook code location', 'hook code class name', 'hook code function to execute') 
    $hook_array['before_save'][] = array(1'case_closed''custom/modules/Opportunities/AlertPopup.php''AlertPopup''alert'); 
    Then I've created the AlertPopup.php file in the same location, and its content is:
    PHP Code:
        if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
     
        class 
    AlertPopup{
            function 
    alert(&$bean$event$arguments){
                
    //Debug content of $bean
                
    $GLOBALS['log']->fatal("<pre>".print_r($bean->fetched_rowtrue)."</pre>");

                
    /*** NEED TO OPEN ALERT POPUP AT THIS POINT ***/
            
    }
        } 
    But now I don't know to open an alert popup. Can anybody help me?
    __
    Federico Piazza
    Developer
    Argentina

  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: How to open a popup within a logic hook?

    Hi Federico

    You should call the popup function on clicking on save button.
    You can redefine the save button to open a popup.

    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.

  3. #3
    fedepia is offline Sugar Community Member
    Join Date
    Aug 2007
    Location
    Rosario, Argentina
    Posts
    104

    Default Re: How to open a popup within a logic hook?

    hi andopes, could you tell me how you do that?
    Thank you very much
    __
    Federico Piazza
    Developer
    Argentina

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Logic Hook - Works in custom, not in main
    By spyro187 in forum Developer Help
    Replies: 4
    Last Post: 2008-06-09, 07:19 PM
  2. Logic Hook help to create tasks when Case is opened
    By lordforbes in forum Developer Help
    Replies: 3
    Last Post: 2007-03-27, 07:29 PM
  3. Adding Logic Hook to existing
    By Superman in forum Developer Help
    Replies: 2
    Last Post: 2006-12-18, 09:38 PM
  4. failed to open stream
    By jrisman in forum Help
    Replies: 0
    Last Post: 2006-09-11, 03:07 AM
  5. Logic Hook Question
    By swhitlow in forum Developer Help
    Replies: 1
    Last Post: 2006-06-04, 04:49 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
  •