Truxton investigation add note

From truxwiki.com
Jump to navigation Jump to search

This will add a note to the investigation object. It will cause a record to be created in the [InvestigatorNote] table.

Syntax

int truxton_investigation_add_note( uint64_t investigation_handle, char const * text );

Parameters

investigation_handle

The handle to the investigation object. This handle comes from calling truxton_investigation_create().

text

The contents of the note.

Return value

A non-zero value on success, zero on failure.

Sample

void create_investigation( void )
{
   uint64_t truxton = truxton_create();

   uint64_t investigation = truxton_investigation_create( truxton );

   truxton_investigation_set_id( investigation, "466C796E-6E27-7320-696E-6E6F63656E74" );
   truxton_investigation_set_name( investigation, "Collusion" );
   truxton_investigation_set_description( investigation, "United States vs. Michael Flynn" );
   truxton_investigation_set_case_number( investigation, "DC-SNAFU-2016.2020" );
   truxton_investigation_set_jurisdiction( investigation, WASHINGTON_DC );
   truxton_investigation_set_status( investigation, INVESTIGATION_STATUS_OPEN );
   truxton_investigation_set_type( investigation, INVESTIGATION_TYPE_FRAUD );

   if ( truxton_investigation_save( investigation ) == 0 )
   {
      printf("Cannot save investigation to the database.\n");
   }

   truxton_investigation_add_note( investigation, "No one will like this investigation." );
   truxton_investigation_destroy( investigation );
   truxton_destroy( truxton );
}