• Why cant i return the full $bean

    I want to return the full bean object after save but, if I try to get the whole bean nothing gets returned in my api The code below saved a bean and I can get the bean ID but I also want to return the full bean $fkeyBean = BeanFactory::newBean…
  • Import Duplicate Detection with Related Fields

    I had a non-db field added to the duplicate check screen on the import process, but that field no longer displays. It was made up of the first_name,last_name, and account_name fields. This no longer appears on the duplicate check dialog. I then created…
  • How to get all cases linke to Opportunity?

    I try to get all cases, linke to an opportunity (for example). I need the information in a LogicHook because i want to link the same cases to another type (in this specific case to a document). I´ve tried a lot, but always unable to fetch the linked…
  • What is the right way to copy a bean

    Hi , what is the right way to create a bean from another existing bean ? in other words, how to duplicate bean in sugar in PHP. i want to keep relationship too.
  • $bean->$link->add is not removing the others

    Hi all. I have an issue where I am adding a relationship on a 1 to Many relationship. So for instance my Lead can only have one Branch linked to it. However when I am doing $bean->$link->add('newId') the old relationship record is not setting itself…
  • How to implement different workflow/process in a Bean

    I have created a generic bean with few columns and relationships. I want to extend this bean so that depending on certain values a different class is called and different process is performed? This is what I am trying to do. - initial bean/module…
  • Does any one knows why the record is not saved but the Audit shows the data has changed?

    Hi All, I have a Question that puzzles me very rarely this happen but does happen!!! So!, the record is not updated but the audit is recording it and cannot find anything that tells was an error? Does anyone know what is the ordering of saving data…
  • Changes in Sidecar model not reflected in Sugar bean

    I have a requirement where a field called resource_rate_actual has be set equal to one of several fields, depending on the value selected in a dropdown. I've set it up in record.js view controller like this: initialize: function (options) { this._super…
  • 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…
  • Using SugarBeanApiHelper with relationships

    Can someone offer advice our point me to some documentation Im trying to retrieve a contact and there related account details, I dont want to retreive everything as I only need selected fields and also want to reduce overheads. I can get this doing an…
  • BeanCollection not in Sugar documentation

    I'd like to bring attention to a Sidecar function called createBeanCollection . I found it to be very useful for loading multiple Sugar records from a single module, as described well in Angel Magana's blog . The problem is that it is not mentioned in…
  • After fetch related beans and update some fields and fetch again gives old records

    in_customer_bean = BeanFactory :: getBean ( "IN_Customers" , $customer_id ); if ( $in_customer_bean -> load_relationship ( 'in_locations' )) { $relatedBeans = $in_customer_bean -> in_locations -> getBeans (); foreach( $relatedBeans as key => $value )…
  • BeanFactory script aborts while executing

    Hi, Iam a newbie at customized Sugarcrm scripts and I would appreciate any help. The script should create a course (training) for every product (Artikel) in a array. A course has relationships with a student (cursist), a product (Artikel) and a company…
  • How do I retrive the member accounts relationship with Bean?

    As the title suggests; I try to retrive the relationship that account have to itself. I have done this using the API (Accounts/link/members) but now I want to do this by using Beans. So, how should I proceed? I've tried the following without success:…
  • 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 remove email addresses through an after save logic hook?

    Hello, All. I would like to scrub bogus email addresses (that are entered during testing, etc) through an after save logic hook. I am able to mark an email address as invalid using the code below. However, I would like to completely remove the email address…