Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By andopes

Thread: Creating custom logic hooks for buttons

  1. #1
    tobydz is offline Sugar Community Member
    Join Date
    Mar 2011
    Location
    Las Vegas, NV
    Posts
    144

    Default Creating custom logic hooks for buttons

    Hello Sugar friends! I've created a custom button on the Notes module detailview called "Next"(and someday a 'Prev' button) which will (eventually) iterate back and forth through all the notes for a given module record without the user having to hit 'back' to see the list of notes in the subpanel view. I'm familiar with using the existing hooks, but I'm going to need it to execute my own code, with the current $bean data available.

    How can this be accomplished, or if there's a better way of doing it, I'm open to anything....

  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: Creating custom logic hooks for buttons

    This is a nice idea to implement, congrats for the insight!
    At first you need to decide what is the ordering criteria. Date Entered? Date Modified? Anything else?
    The action of such button must be a custom action, to be defined inside custom Notes controller.
    This action must combine search criteria, current record and parent type in order to fetch either the next or last one, then redirect page to such record.

    Cheers
    tobydz likes this.
    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
    tobydz is offline Sugar Community Member
    Join Date
    Mar 2011
    Location
    Las Vegas, NV
    Posts
    144

    Default Re: Creating custom logic hooks for buttons

    Quote Originally Posted by andopes View Post
    This is a nice idea to implement, congrats for the insight!
    At first you need to decide what is the ordering criteria. Date Entered? Date Modified? Anything else?
    The action of such button must be a custom action, to be defined inside custom Notes controller.
    This action must combine search criteria, current record and parent type in order to fetch either the next or last one, then redirect page to such record.

    Cheers
    Thanks for the compliment Andre! =D Ok great I'll look into the controller. For the purposes of our company, we don't allow employees to edit notes, so I'll be basing this upon Date Created (since there is not Date Modified for us). I'll post to this thread if I have any questions!

    Cheers!

  4. #4
    iDavide's Avatar
    iDavide is offline Sugar Community Member
    Join Date
    Jan 2012
    Posts
    10

    Default Customize the action in save button

    Hi, I'm new to Sugar and I really need help.

    I created a new module using sugar "module builder" as a model that uses the "base". I created all the parameters set by the instrument "study", but I need to add a "custom action" when you click the save button. that is, when I click on the button "save" is made even my code.

    I tried the file with actions triggered on click "save" to add my code but I have not found anything.
    Congratulations to everyone for the great advice in the forum, I hope in your help. Many thanks in advance

  5. #5
    SagarCRM's Avatar
    SagarCRM is offline Sugar Community Member
    Join Date
    Oct 2011
    Location
    Mumbai, Maharashtra, India
    Posts
    111

    Default Re: Creating custom logic hooks for buttons

    hi iDavide,

    why you are trying to customize your save button?? you can code in logic hook event hooks after_save or add new custom button and write your code there. Will it complete your achievement???
    --

    Thanks & Regards,

    Sagar Salunkhe
    Mumbai, Maharashtra, INDIA

    sagar.salunkhe1991@gmail.com

    ~~ IT professionals never dies, they just go Offline... ~~


    sugar development and support services:- indian.sugarbean@gmail.com

  6. #6
    iDavide's Avatar
    iDavide is offline Sugar Community Member
    Join Date
    Jan 2012
    Posts
    10

    Default Re: Creating custom logic hooks for buttons

    thanks for the answer!
    I built my "custom module" with module builder, when i click on save button I need to run my "custom query" on a value entered, and that I update a field in another table.
    I am new to Sugar, what can I do?
    - Create a new module controller with post_save action?

    you could give me an example? thanks a lot, best reguards!

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: 2011-10-13, 04:40 PM
  2. Logic Hooks in custom module
    By Rajesh Patel in forum Help
    Replies: 7
    Last Post: 2009-11-06, 07:01 AM
  3. Replies: 1
    Last Post: 2009-09-13, 11:28 PM
  4. Custom logic hooks
    By milescook in forum Developer Help
    Replies: 2
    Last Post: 2009-03-05, 04:03 PM
  5. Custom Fields-do I need to use Logic Hooks??
    By ctaylor2410 in forum Developer Help
    Replies: 2
    Last Post: 2008-10-24, 08:19 AM

Tags for this Thread

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
  •