AnsweredAssumed Answered

Is it possible to hard set created_by and modified_user_id when create call via REST ?

Question asked by Autchara Chaiprom on Jun 1, 2016
Latest reply on Jun 2, 2016 by Tevfik Tümer

Hi all,

 

I need to set created_by and modified_user_id to specified id

Is it possible to do this?

Problem is when I create Call via REST in Call contains 2 guests user(specified id) and REST authentication user.

I would like to set only for specified id, not REST authentication user.

 

For example: I would like to cut Ko(REST authentication user) off.

 

Capture3.PNG

 

My code:

$base_url = "{$sugar_config['site_url']}/rest/v10";
$username = "<Ko username>";
$password = "<Ko password>";

//function call(
//oauth

$url = $base_url . "/Calls/";
        $record_arguments = array(
                "name" => "Service",
                "description" => "",
                "parent_id" => $_POST['parent_id'],
                "parent_type" => $_POST['module'],
                "date_start" => $date_start,
                "duration_minutes" => $_POST['min'],
                "modified_user_id" => "1",
                "created_by" => "1",
               //set for specified user
                "assigned_user_id" => $_POST['user'],
                "modified_user_id" => $_POST['user'],
                "created_by" => $_POST['user'],
               //----------------------
                "team_id" => $team_id,
                "team_set_id" => $team_id,
        );
        $record_response = call($url, $oauth2_token_response->access_token, 'POST', $record_arguments);

 

Sugar 7.6 Ent

Thanks,

M

Outcomes