How to set date_modified through REST API

I want to set the date_modified field of Notes that I am importing through the REST API. However, I can't see any way to turn off the automatic updating of date_modified in the REST API, if I try setting update_date_modified to false this has no effect.

An example of data I am sending via an HTTP PUT:

{
   "update_date_modified": false,
   "date_modified": "2016-02-09T10:12:52.0000000"
}

The request works but the date_modified is set to the date of the request, not the value I set

Parents Reply Children
  • Thanks for the reply - I will look at a save logic hook.

  • Is that a recent change?

    I have done several custom imports of data from other systems in the past and wanted to preserve the modified/created dates and modified/created users


    Working directly with the bean I successfully used:   

       //set a bunch of other values for the bean... 
       
       //set the create and modified to the original record's values
       $tbean->date_entered = $orig_created_date;
       $tbean->date_modified = $orig_date_modified;
       $tbean->created_by = get_sugar_user_id($orig_create_user_name);
       $tbean->modified_by = get_sugar_user_id($orig_modified_user_name);
       
       //these flags prevent the save process from overriding created by and modified by
       $tbean->update_date_modified = false;
       $tbean->update_modified_by = false;
       $tbean->set_created_by = false;
       $tbean->update_date_entered = false;
       $tbean->save();

    FrancescaS