tag:blogger.com,1999:blog-2219864625861728790.post1074204021692609212..comments2024-01-28T05:19:49.173-08:00Comments on Angel's Blog: Simple SugarCRM Logic Hook ExampleAngel Magañahttp://www.blogger.com/profile/09861818705795234299noreply@blogger.comBlogger112125tag:blogger.com,1999:blog-2219864625861728790.post-43057298199943531362018-04-09T22:12:47.507-07:002018-04-09T22:12:47.507-07:00hii can you help me for make suggestion box in sui...hii can you help me for make suggestion box in suitecrm Anonymoushttps://www.blogger.com/profile/07460902770250713313noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-9848291144088368862018-03-20T08:25:00.007-07:002018-03-20T08:25:00.007-07:00Thanks for the feedback. I will take it into consi...Thanks for the feedback. I will take it into consideration for future posts.Angel Magañahttps://www.blogger.com/profile/09861818705795234299noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-46439455184637818112018-03-09T02:35:31.976-08:002018-03-09T02:35:31.976-08:00Thank you. It helped Me. And a small suggestion, i...Thank you. It helped Me. And a small suggestion, it would be really very good if related information about the code is given for each line of code since i am newbie.Shilpa Josephhttps://www.blogger.com/profile/02278478276462632990noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-63270575950037954312018-02-01T03:13:35.198-08:002018-02-01T03:13:35.198-08:00Hello Angel i am using ases as refunds and i have ...Hello Angel i am using ases as refunds and i have refund_amount_c in cases and refund_amount_c in accounts what i need is whenever i create a case related to the account and add refund amount then that refund amount should show in the accounts detail view... I tried to modify your Query but it is not working can you help me with that please??<br />Anonymoushttps://www.blogger.com/profile/03375014361535954614noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-91740174827336620742016-03-07T14:38:03.958-08:002016-03-07T14:38:03.958-08:00If the hook is being executed when a Contact is sa...If the hook is being executed when a Contact is saved, wouldn't the "account_type" field on the Contact record have a name other than "account_type?" <br /><br />I would assume it would be a custom field, but even if not, I doubt it is "$bean->account_type" as $bean = current contact in this context, not the Account record.<br /><br />Also, can you define whatAngel Magañahttps://www.blogger.com/profile/09861818705795234299noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-2017592478813253972016-03-01T03:59:43.661-08:002016-03-01T03:59:43.661-08:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/05155175929425085292noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-76794040201638960022016-03-01T03:56:22.134-08:002016-03-01T03:56:22.134-08:00Hi Angel,
I don't know if you are still contr...Hi Angel,<br /><br />I don't know if you are still contributing to this blog, but thought I'd ask anyway! I need to populate a custom field from Accounts to Contacts so I can then expose that to MailChimp. The field in Accounts is Account_Type.<br /><br />I have copied your initial code and modified it for what I thought would work. Unfortunately it doesn't. I was hoping that you Anonymoushttps://www.blogger.com/profile/05155175929425085292noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-36388911480317065372014-12-18T12:23:59.190-08:002014-12-18T12:23:59.190-08:00If you intend to do that at the time that the user...If you intend to do that at the time that the user select "Product" in the Type field, you wouldn't be able to do it via a logic hook. You need to create a dependency between the type and subject fields, which is not done through logic hooks.<br /><br />If you are using Community Edition, you should take a look at using this tool: http://www.sugarforge.org/projects/devtoolkit/Angel Magañahttps://www.blogger.com/profile/09861818705795234299noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-52265037031386682492014-12-17T21:52:24.562-08:002014-12-17T21:52:24.562-08:00Hi, I am using Sugarcrm Version 6.5.18. I would li...Hi, I am using Sugarcrm Version 6.5.18. I would like to link the fields up such as when I choose "Product" as my Type field and my subject box field will appear as "RE: Product". How can I link both of them up and where do I edit the code at using Logic Hook? Am I suppose to use ['before_save']? I am new to Sugarcrm. Thanks.Florence Yuenhttps://www.blogger.com/profile/04426941438864371220noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-22657172828897354332014-12-17T21:52:08.573-08:002014-12-17T21:52:08.573-08:00Hi, I am using Sugarcrm Version 6.5.18. I would li...Hi, I am using Sugarcrm Version 6.5.18. I would like to link the fields up such as when I choose "Product" as my Type field and my subject box field will appear as "RE: Product". How can I link both of them up and where do I edit the code at using Logic Hook? Am I suppose to use ['before_save']? I am new to Sugarcrm. Thanks.Florence Yuenhttps://www.blogger.com/profile/04426941438864371220noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-85834069582243313352014-11-24T22:34:46.516-08:002014-11-24T22:34:46.516-08:00Hey Angel, may I know, when user changes his passw...Hey Angel, may I know, when user changes his password how to get that new password at the same time using logic hook when user presses save button to change password. I have checked using after_save, but no result. Thank you.Anonymoushttps://www.blogger.com/profile/05113033136335389191noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-78742081677261897762013-10-28T13:13:38.264-07:002013-10-28T13:13:38.264-07:00I am new to sugar and php and i Could really use y...I am new to sugar and php and i Could really use your help. I want to create a after_save hook that will send a email to multiple person in a department once a record is assign to that department. <br />I would really appreciate your help.NaeNaehttps://www.blogger.com/profile/03341349157935881509noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-22682556066011611822013-10-28T13:03:06.572-07:002013-10-28T13:03:06.572-07:00Could you help me to do this. I want to create a a...Could you help me to do this. I want to create a after_save hook that will send a email to multiple person in a department once a record is assign to that department. <br />I would really appreciate your help.NaeNaehttps://www.blogger.com/profile/03341349157935881509noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-74089006640307639442013-08-09T03:08:06.396-07:002013-08-09T03:08:06.396-07:00Hello Angel
Can you please tell how to integrate ...Hello Angel<br /><br />Can you please tell how to integrate sugarcrm with drupal through logic hooksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-52904367568221010242013-02-28T09:55:23.584-08:002013-02-28T09:55:23.584-08:00Here are a couple of examples of how to send email...Here are a couple of examples of how to send email using code. You could incorporate that into your logic hook and accomplish your goal:<br /><br />http://cheleguanaco.blogspot.com/2011/06/sugarcrm-customization-workflow-emails.html<br /><br />http://cheleguanaco.blogspot.com/2009/11/sugarcrm-customization-custom-workflow.html<br /><br />http://cheleguanaco.blogspot.com/2012/04/Angel Magañahttps://www.blogger.com/profile/09861818705795234299noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-15092263943161947632013-02-28T07:21:17.146-08:002013-02-28T07:21:17.146-08:00the one question i am trying to get is to have a l...the one question i am trying to get is to have a logic hook to send an email when a case is assigned.<br /><br />email address must be static.<br />subject is assigned users mobile number<br />description is case subject, one custom field and account name,and 2 custom accounts fields?<br /><br />and a string open http://blablabla/do.php?case_number = $case_number?assigned_user=$assigned_user(casepaul vzn zylhttps://www.blogger.com/profile/18391815097521650825noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-29621204969616964822012-11-21T08:28:25.717-08:002012-11-21T08:28:25.717-08:00It is blank for a couple of reasons...
Your query...It is blank for a couple of reasons...<br /><br />Your query is not returning the column named "name," it is instead returning a count of records in the table named "cutsom_table," based on the "name" column. This would return a number, not the contents of the name table. <br /><br />This is why $row['name'] fails, as there isn't a column named "nameAngel Magañahttps://www.blogger.com/profile/09861818705795234299noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-52322970037012052632012-11-21T06:26:59.423-08:002012-11-21T06:26:59.423-08:00How would the handling of the variable $results ch...How would the handling of the variable $results change if the SQL call was a COUNT? <br />So far I have: <br /><br />$query = "SELECT COUNT(name) from cutsom_table";<br />$result = $bean->db->query($query, true);<br />$row = $bean->db->fetchByAssoc($result);<br />$num = $row['name'];<br /><br />And $num variable is blank. Thoughts? <br />Melissahttps://www.blogger.com/profile/10297861645882260622noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-89387942843251886502012-11-20T20:38:48.402-08:002012-11-20T20:38:48.402-08:00There are a couple of ways of tackling this, but t...There are a couple of ways of tackling this, but the most basic way would be to have some sort of switch statement in your logic hook which examines the ID of the current user saving the case and then based on that value, it changes the assigned user to the appropriate supervisor.<br /><br />For example, <br /><br />$saving_user_id = $bean->modified_user_id;<br /><br />switch($saving_user_id)<Angel Magañahttps://www.blogger.com/profile/09861818705795234299noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-68979603582388634112012-11-20T20:19:19.927-08:002012-11-20T20:19:19.927-08:00Angel, I am new to SugarCRM and currently trying t...Angel, I am new to SugarCRM and currently trying this out. Though I an idea that I want to do but don't know how. Here's the scenario:<br />- I want to configure the CRM so that when "Agent A" saves a Case, it gets assigned to "Supervisor C". <br />- Also, when "Agent J" saves a Case, it gets assigned to "Supervisor D".<br /><br />It's more wynd247https://www.blogger.com/profile/10359836384406142922noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-13221154731297008612012-10-08T18:23:54.701-07:002012-10-08T18:23:54.701-07:00Logic hooks don't interact with the interface,...Logic hooks don't interact with the interface, or better stated, aren't designed to, so a popup is not something that can be easily accomplished via a logic hook.<br /><br />You could create an after_save hook that sends an email instead or executes code that sets the desktop notification.Angel Magañahttps://www.blogger.com/profile/09861818705795234299noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-67743695260253219332012-10-08T05:32:45.855-07:002012-10-08T05:32:45.855-07:00Hi friends,
I am newbie in SugarCE v 6.5.4 , I nee...Hi friends,<br />I am newbie in SugarCE v 6.5.4 , I need a requirement in which when I create a new campaign I need to create a desktop or popup notification to Administrator , and can see when he login .<br />Do you please help me to do the same . Please advise me with code and ideas .<br /><br />Thanks, <br /><br />Anes<br />aneshttps://www.blogger.com/profile/01831677732671241015noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-487728177330426192012-08-24T15:22:26.134-07:002012-08-24T15:22:26.134-07:00The log file is about the best way. You should ins...The log file is about the best way. You should insert some log calls in your code at different points to see where it is failing, assuming it is even being executed.Angel Magañahttps://www.blogger.com/profile/09861818705795234299noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-42507454703873786972012-08-24T06:30:51.942-07:002012-08-24T06:30:51.942-07:00Angel,
Thank you so much for the quick reply. Tha...Angel,<br /><br />Thank you so much for the quick reply. That is exactly what I was looking for. Do you have any tips on debugging/diagnosing logic hooks? Mine is not returning any errors in the logs but it still does not work. My code is below, in case you have a second to look at it:<br /><br /> //get account salesman and account name<br /> require_once('modules/Accounts/Account.php')Anonymoushttps://www.blogger.com/profile/03622091828033180971noreply@blogger.comtag:blogger.com,1999:blog-2219864625861728790.post-71526827570692713212012-08-23T07:26:59.412-07:002012-08-23T07:26:59.412-07:00Hi Joe,
Happy to hear you have found it helpful.
...Hi Joe,<br /><br />Happy to hear you have found it helpful.<br /><br />If your current bean is a call, $bean->parent_id would give you the ID of the linked Account. So you could do something like this:<br /><br />require_once('modules/Accounts/Account.php');<br />$acct = new Account();<br />$acct->retrieve($bean->parent_id);<br />$account_salesman_id = $acct->assigned_user_id;Angel Magañahttps://www.blogger.com/profile/09861818705795234299noreply@blogger.com