How to create a new field in a bean from module Notes?

I am using a module called notes to keep track of emails so that I can view both emails and notes in the sugar portal.  Right now the portal is only set up to view the notes associated with a case and not emails. Our work around to this is going to be to create a new note whenever there is an existing case and an email is sent.

I need to know if I can create a new field in a notes bean.  I know that I can create variables to use in a bean on the fly but when I did a save I don't see it in the database as a new column.

How do I use a bean to create a new column in the database?

  • I am not sure I understand what you are trying to accomplish, but fields are either created through Studio or manually, via vardefs. The bean is a representation of an object and the database connection, not the dictionary (which is what vardefs includes).

    Why is it that you need this field in the first place? I don't quite understand the need for it.

  • So I populate the note bean from the email bean in a before save hook in the email module. I wanted to make some more fields in the bean and also save those to the db to try to mimic the email bean.  The reason for this is that the portal only supports notes and some others but not emails. We need to have the ability to put emails into the portal.

    Our team here wanted to do this because we thought this would be more upgrade safe than making an api call and manipulating the javascript to get the result that we wanted in the sugarCRM portal.


  • I am not sure why you wouldn't be able to accomplish that by:

    1. defining your Notes custom fields in Studio

    2. using $NoteBean->[custom_field_name_c] = <some_value>; in the Email logic hook

    If the Note object has a custom field defined, I can reference it via SugarBean just like I can any other field.

  • Okay well it was probably a pretty easy question, but I was just overwhelmed with the goal of getting that in portal in a upgrade safe manner so I just wanted to make sure.

    Thank you Angel Magana