create custom field in sugarcrm database and get that value using REST

Hi

I just created a custom field in in database(in user table, i don't know it is good way or not), now i want to get the custom field value using REST api,all value are retrieving except my custom field. Below is my rest api params

$get_entries_parameters = array(

         'session' => $session_id,

         'module_name' => 'Users',

         'ids' => array('1'),

         'select_fields' => array(

            'user_name',

            'first_name',

            'reports_to_id',

          'mycustomfield',

         ),

         'link_name_to_fields_array' => array(),

        );

    $get_entries_result = call("get_entries", $get_entries_parameters, $url);

all value are return except my customfield how i get this.

Parents
  • Aravinth,

    Since this field was created directly in the database, it is possible that there are missing components that are required by Sugar.  When a field is created via Studio, a vardef file is created on the file system, along with the field being created in the [module]_cstm table and fields_meta_data table within the database.

    If you create the field via Studio, the REST call should return results.

    For reference, here is a link to developer guide that walks you through manually creating a field.

    You can also review this document on creating fields in Studio.

    Hope this helps,

    Lori

  • Thank you so much for your reply. I just created the field directly in database(is that good or not).For accessing this value in REST call, modified the cache/module/module-name/vardefs solved the issue.

    How to update the custom field (created using studio) using REST api.

  • Aravinth,

    I am not sure if this page will help, but thought I would pass it along.  The page contains several examples of creating and updating records using REST.

    Kind Regards,

    Lori

  • Thanks for you reply. Reference page doesn't have any samples like that but i am able to update the custom field using REST.

    Thanks.

Reply Children
No Data