well, there are two things you can do. If you wanted this to happen for every record, i.e. automatically, then you can write logic hooks to synchronize the two tables (note that you'd have to add an extra field in each module to keep a record of what record the current record is synchronized to). If you only wanted to do it for specific records, or at specific times, I haven't done this but you can get a pretty good idea by looking at the leads' convertlead functionality. You can add custom functionality to a button and create a special view to go to when that button is pressed. The button is added in the viewdefs file (editviewdefs.php, detailviewdefs.php; whichever view you feel it applicable to add to. You can see this being done in the following code which is pulled from modules/lLeads/metadata/detailviewdefs.php: PHP Code:
$viewdefs['Leads']['DetailView'] = array (
'templateMeta' => array (
'form' => array (
'buttons' => array (
...
array (
'customCode' => '<input title="{$MOD.LBL_CONVERTLEAD_TITLE}" accessKey="{$MOD.LBL_CONVERTLEAD_BUTTON_KEY}" type="button" class="button" onClick="document.location=\'index.php?module=Leads&action=ConvertLead&record={$fields.id.value}\'" name="convert" value="{$MOD.LBL_CONVERTLEAD}">'
),
If you look at modules/Leads/views/view.convertlead.php you can see where this button references.
Note that there's probably going to be a little more to this process than I've uncovered. There are some labels there that need to be defined and I'm guessing you might have to fiddle with the controller as well. Also, remember to put all your modifications in the custom directory so that you stay upgrade safe.
Bookmarks