• Logic hook can't find link name of relation

    Hello All, I'm looking for help with figuring out why a new logic hook works well on my local Sugar instance but does not work in the online instance. This is an after_save logic hook in the RevenueLineItems module that automatically creates/updates records…
  • Setting Default Record Names on Record Creation

    Step 1. Select "Create" from the Quotes Module ListView to create a new record. OR Step 2. Select "Create" (the + button) from a related module (Accounts) in the sub panels. When the pop up window shows (the cached version of the new Quote record), I…
  • Why call bean->save() in before_save logic hook?

    The documentation on before_save logic hooks states that "calling save on the bean in this hook will cause an infinite loop if not handled correctly". I'm curious, what are the circumstances when you would need to call save on a bean in a before_save…
  • Set selected_teams (padlock) in Logic Hook

    Hello All, I am working on SugarCRM Enterprise, Version 9.0.2 (Build 191) (Spring '19) I can set padlock (which is used for teams with special access: O&ST) from record.js but I want to set it from hook. I want to achieve same functionality from before_save…
  • SugarCrm add a column to leads list page.

    I've to add a column in leads list view page. I've tried this... custom/Extension/modules/Leads/Ext/LogicHooks/specQuickEditButton.php <?php $hook_array['process_record'][] = Array(1, 'Add Quick Edit Button in ListView', 'custom/SpecCustom/LogicHooks…
  • Get id of sent email

    Hi, In after_save logichooks I used "$mail = new SugarPHPMailer();" for sending emails I need to get the ID of email which is sent. I tried to get id from "$mail->id" but its not working Basically I need to use email_id in this logic ( https://support…
  • How to remove a team from users->Access->My teams ?

    Hi All, I am trying to remove the global team from user's profile by the following code in logic hook //Retrieve the bean $bean = BeanFactory::getBean($module, $record_id); //Load the team relationship $bean->load_relationship('teams'); //Remove the teams…
  • Adding user input into Edited field

    I want to add an edit function if user decides to change the field value but i cant seem to find the right way to do this. Ive tried searching through google but it doesn't give any answer related for this problem. code here: <?php class CloseTicket …
  • How to define Logic hook alongside Advance Workflow?

    Hello, let's assume, that I want to create Logic Hook and Advanced Workflow without timer. Advanced Workflow (Process definition): will run on Leads New records only criteria is Lead source equals "Newsletter" and result will be, that this Lead will have…
  • Invalid usage of a function array_map()

    When trying to upload a package containing a logic hook to a sugar on demand environment, I am getting the error "Invalid usage of a function array_map()" The usage of array_map is here: $serviceTypeList = array_map ( "trim" , $serviceTypeList ) ; The…
  • Modify Relate field using Logic Hook

    Is it possible to change a Relate field (not relationship or Flex Relate) using a logic hook in Sugar Enterprise 7.9.1.0? If so, how? Thanks!
  • Email Logic Hook - After save

    Hello, I would like to execute a specific code after an email is received. The code parses the email subject and do specific actions. I would like a more custom way than binding the email with a case from the subject ( [Case:XXX] to Case XXX) However…
  • Installable package failed - "unable to load bean"

    Hi. I'm trying to install a custom package that turns "Opportunity Name" field required in the Quotes module but I get an error in the Log: Mon Apr 24 21:36:22 2017 [3491][01d5bbea-1fa2-11e7-afde-063b661e1dc5][FATAL] Unable to load bean Mon Apr 24 21…
  • How to set multiple team when create new record via logic hook

    Hi, I try to create case record and put multiple teams, one is primary team(fetch from parent) another is team id but it doesn't work. $c = BeanFactory : : newBean ( 'Cases' ) ; $c - > name = 'Test' ; $c - > status = 'New' ; $c - > assigned_user_id =…
  • Method get_linked_beans() always returns empty list when triggered from Workflow

    Hi, I have set up a simple before_save logic hook for the Accounts module. When an account is saved the related contacts are retrieved using the get_linked_beans method. This works perfectly fine when manually editing and saving a record, but when using…
  • How can I get all status of cases via load_relationship in logic hook

    Hi I found this in document http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.7/Data_Framework/Models/SugarBean/#Fet… I put in to logic hook its work but it return huge result. How can I get all status from this ? any suggestion…
  • Any idea for after_save logic hook to check data change ?

    Hi all, I have 2 ways to do. The first is using before save and after save for check data was changed I have been used in sugar 6.5 before. http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.7/Architecture/Logic_Hooks/Examples…
  • Show notification that a logic hook triggered

    I need to show a notification that some fields were automatically updated by a logic hook. When saving an account or contact, it checks for certain flags to be set across all contacts. If it is the only contact attached to an account, the flags get set…
  • can I apply an after save hook for a sub panel?

    I want to do an after save hook for a sub panel, I tried adding it like what you would do for the main module but when I tried in when it in the sub panel it didn't work, but when I tried it using its main module it did work. So I'm guessing there is…
  • how to get the recently added bean id in after save logic hooks?

    I would like to retrieve the most recent id of an inserted data inside the after save method of logic hooks. How should I proceed with this? Thank you
  • How to throw and cach Logic Hook errors/exceptions and send error messages to log/GUI?

    Hello! I just wrote my frist Logic Hook, to clean and stardise the Accounts names (Company names) with a before save hook, like this: <?php class Clean { function CleanName($bean, $event, $arguments) { $companyname = $bean->name; $companyname = ucwords…
  • How to clean text with Logic Hook formula?

    Hello! Im newbie in Logic Hooks. I want to write a Logic Hook int the Account module that clean inserted text data after saving. In Excel I used the : TRIM, CLEAN and PROPER functions like this: =PROPER(TRIM(CLEAN(Text))) The formula is removed the extra…
  • Logic Hook not working - Sugar Enterprise Edition

    Hello. I'm using SugarCRM Enterprise Edition 7.5.2.4, using an "On Demand" instance. I developed a logic hook to the native module "RevenueLineItems", that is related to the module "Opportunities". The logic is: on creating a RevenueLineItem (here I will…
  • MySQL query works in NaviCat but not in SugarCRM

    If any additional information is needed that would help you solve the problem, just let me know. I'm running SugarCRM 6.5.20 CE I have a logic hook that fires for a custom module and when I go to check the log, the query shows an execution time and appears…
  • Is there a way to Uppercase ALL fields in a record?

    I mean uppercase all fields without having to go through this.. $bean->first_name = strtoupper($bean->first_name); $bean->last_name = strtoupper($bean->last_name ); $bean->address = strtoupper($bean->address ); $bean->gender = strtoupper($bean->gender…