$note = new Note();
$note->modified_user_id = $current_user->id;
$note->name='invoiced on ' . date('d/m/Y');
$note->description='next due: '.$bean->next_due.'; rate: '.$bean->rate;
$rel_name = 'inv_invoices_notes_1';
However you need to know the name of the relationship - in this case inv_invoices_notes_1, .
This relationship was created in Studio between 2 already existing modules.
You can get the relationship name from a php file called vardefs.ext.php - in custom/module/<module-name>/Ext/Vardefs/:
// created: 2013-04-18 06:00:38
$dictionary["INV_Invoices"]["fields"]["accounts_inv_invoices_1"] = array (
'name' => 'accounts_inv_invoices_1',
'type' => 'link',
'relationship' => 'accounts_inv_invoices_1',
'source' => 'non-db',
'vname' => 'LBL_ACCOUNTS_INV_INVOICES_1_FROM_ACCOUNTS_TITLE',
'id_name' => 'accounts_inv_invoices_1accounts_ida',