How to know if a field is audited in a module

Hi All,

           How to know if a field is audited in a module,in its logic hook

Regards

Sidhu

Tevfik Tümer Avinash Singh Bhavesh Patel

Parents Reply Children
  • Ah ok now I see. Which version are your running? 

    In Sugar7 with Rest v10 you can use GET /metadata to receive all fields etc. In the following example I got the whole metadata for Accounts. In there you will find the fields and for each audited field you will see

     [audited] => 1
    $url = $base_url . "/oauth2/token";

    $oauth2_token_arguments = array(
        "grant_type" => "password",
        //client id/secret you created in Admin > OAuth Keys
        "client_id" => "test",
        "client_secret" => "test",
        "username" => $username,
        "password" => $password,
        "platform" => "base"
    );

    $oauth2_token_response = call($url, '', 'POST', $oauth2_token_arguments);

    //Endpoint - GET /<metadata>/

    $url = $base_url . "/metadata/";

    $record_arguments = array(
        "module_filter" => "Accounts",
    );

    $record_response = call($url, $oauth2_token_response->access_token, 'GET', $record_arguments);