Results 1 to 6 of 6

Thread: Help needed to update "sales stage"

  1. #1
    swaroops1 is offline Senior Member
    Join Date
    Jul 2010
    Posts
    43

    Unhappy Help needed to update "sales stage"

    Hi,

    Help is desperately needed to update "sales stage"(sales_stage_dom) from the call module (EditView)i.e, from the subpanel after close is pressed. I have added a Drop Down in the Call (EditView) but stuck where to place the code. The main idea is to update sales stage after each activity if any..

    whether this can be achieved from Logic Hooks ? ? ?

    Please do provide your feedback at the earliest..

    Thanks for reading this... ! ! !

    Hope Sugar Developers and Community Help !
    Last edited by swaroops1; 2010-08-06 at 08:16 AM. Reason: spelling mistake

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

    Default Re: Help needed to update "sales stage"

    A logic hook would be the way to go ..

  3. #3
    swaroops1 is offline Senior Member
    Join Date
    Jul 2010
    Posts
    43

    Red face Re: Help needed to update "sales stage"

    Thanks for swift reply salesagility.

    Can you please tell in detail how can I achieve this. What would be the code and where to place it would really be a very great help...

    I have used the same sales_stage_dom for the dropdown which is appearing, but I am confused how to handle it...

    Awaiting ....

    Thanks ..

  4. #4
    shailendra001's Avatar
    shailendra001 is offline A Prolific Poster
    Join Date
    Oct 2008
    Location
    Bangalore India
    Posts
    255

    Smile Re: Help needed to update "sales stage"

    Hi ,

    try something like this


    in custom/modules/Calls/logic_hooks.php


    <?php
    $hook_version = 1;
    $hook_array = Array();

    $hook_array['before_save'] = Array();
    $hook_array['before_save'][] = Array(
    0,
    'UpdateSalesStage',
    'custom/modules/Calls/UpdateSalesStage.php',
    'UpdateSalesStage',
    'UpdateSalesStage'
    );
    ?>

    and in custom/modules/Calls/UpdateSalesStage.php


    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    require_once('data/SugarBean.php');

    class UpdateSalesStage {

    function UpdateSalesStage(&$bean, $event, $arguments)
    {

    // Only for old records of calls module where status is held
    if(!empty($bean->fetched_row['id']) && $bean->status=='Held')
    {

    // code to modify slaes stage of opportunity module when status is Held

    require_once('modules/Opportunities/Opportunity.php');

    $obj = new Opportunity();
    $obj->sales_stage = $bean->sales_stage_c;
    $obj->assigned_user_id = $bean->assigned_user_id;
    $obj->id = $bean->parent_id;
    $obj->save();



    }

    }
    }



    ?>






    Have fun

    Shailendra
    Last edited by shailendra001; 2010-08-06 at 11:44 AM.

  5. #5
    swaroops1 is offline Senior Member
    Join Date
    Jul 2010
    Posts
    43

    Default Re: Help needed to update "sales stage"

    Hi Shailendra,

    Thanks you for your kind reply. Will check this out and I will be back with the results..

    Once Again thanks for the help extended..

  6. #6
    swaroops1 is offline Senior Member
    Join Date
    Jul 2010
    Posts
    43

    Cool Re: Help needed to update "sales stage"

    Hi Shailendra,

    Worked like a charm with no addition or deletion..

    Thanks a million.. I was stuck with this whole day where to start.. you made my day...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 2010-07-20, 04:01 AM
  2. Replies: 1
    Last Post: 2010-07-06, 01:53 AM
  3. Replies: 2
    Last Post: 2010-07-06, 01:13 AM
  4. After Update "Content" will be replaced to "c"
    By hijacker in forum Installation and Upgrade Help
    Replies: 2
    Last Post: 2008-03-11, 05:02 AM
  5. Today's "Comments" from our sales group.
    By jjwdesign in forum Feature Requests
    Replies: 4
    Last Post: 2008-01-14, 02:32 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
  •