Hi, I'm using SugarCRM 5.2.0k.

I made a custom html view page.
What I want to do is to insert a relation record into a relation table.
Since the view page is custom html page like below, I put a new action to insert a value of the view.

<custom/modules/mymodule/views/view.listdetail.php>
PHP Code:
class mymoduleViewListDetail extends ViewListDetail{
    function 
display(){
        
$html '';
        
$html .= '<table>';
        ......
        
$html .= '<input type=\'text\' name=\'due_date\' id=\'due_date\'>';
        ......
        
$html .= '<button type=\'button\' class=\'button\' title=\'update\' onClick=\'document.location.href="index.php?action=update&module=mymodule";\'>Update</button>';
        ......
        
$html .= '</table>';
        echo 
$html;
    }

And there are table A and B. the relation is 1 to many.
The page above is showing A information readonly and writable B information(10 rows).
I managed to insert B data, but I'm struggling to insert the relation table between A and B.
Can anybody help me?

Here is the controller that I customized.
<custom/modules/mymodule/controller.php>
PHP Code:
class mymoduleController extends SugarController{
    function 
action_update(){
        require_once(
'modules/Con_contract_jams/Con_contract_jams.php');

        
$mymod = new mymodule();
        
$mymod->item1 item1 from view;
        
$mymod->save();
    } 
In the above case, how can I insert the relation AB table?

Thank you very much in advance.