Custom action button puts page in edit mode

I have created a custom action button on the detail view which opens a new window, however it puts the old window in to edit mode. I don’t want this, i just want it to be left where it was.

Using this here:

i have modified it to open in a new window with this code: https://suitecrm.com/suitecrm/forum/developer-help/7839-add-button-to-detail-view-of-module

5 => 
	array (
	  'customCode' => '<input type="submit" class="button" title="View Jobsheet" name="View Jobsheet" value="View Jobsheet" />',
	  'sugar_html' => 
	  array (
		'type' => 'submit',
		'value' => 'View Jobsheet',
		'htmlOptions' => 
		array (
		  'class' => 'button',
		  'id' => 'genFile_button',
		  'title' => 'View Jobsheet',
		  'onclick' => 'window.open(\'index.php?entryPoint=plotsheet&id=\'+\'{$bean->id}\');', 
		  'name' => 'View Jobsheet',
		),
	  ),
	),

I have notice that the suitecrm.log produces this error when the button is clicked, but the new page does open and works ok.


Wed Dec 19 16:27:05 2018 [5920][1][FATAL] Exception handling in /var/www/html/include/MVC/Controller/SugarController.php:402
Wed Dec 19 16:27:05 2018 [5920][1][FATAL] Exception in Controller: Error retrieving record. This record may be deleted or you may not be authorized to view it.
Wed Dec 19 16:27:05 2018 [5920][1][FATAL] backtrace:
#0 /var/www/html/include/MVC/View/views/view.detail.php(101): sugar_die('Error retrievin...')
#1 /var/www/html/include/MVC/View/SugarView.php(207): ViewDetail->display()
#2 /var/www/html/include/MVC/Controller/SugarController.php(432): SugarView->process()
#3 /var/www/html/include/MVC/Controller/SugarController.php(375): SugarController->processView()
#4 /var/www/html/include/MVC/SugarApplication.php(109): SugarController->execute()
#5 /var/www/html/index.php(52): SugarApplication->execute()
#6 {main}

any help would be great.

Thanks

I havenotice this is doing it to all my custom buttons, It actions the code, but still ends up in edit mode of the sending module.

So i have another button that calls a custom enrty point, which creates a record and then diverts the page to that record. It is working fine in my lab, but on the porduction system, It creates the record but instead of diverting to the new records it ends up in the current record, but in edit mode

This time the error message is:

Wed Dec 19 16:33:55 2018 [6813][-none-][FATAL] SECURITY: User authentication for administrator failed
Wed Dec 19 16:33:55 2018 [6813][-none-][FATAL] FAILED LOGIN:attempts[1], ip[172.16.1.140], username[administrator]

The two boxes have different admin usernames, but it is not reference in the code that has been moved over,

any advice would be good.

I have found that if the action buttons are in a dropdown box (system setting) they work fine, it is as soon as i have the button out of the drop down menu and along the top of the module it does this.

try your button code like following.


  'customCode' => '<input type="button" class="button" onClick="window.open('index.php?entryPoint=plotsheet&id={$fields.id.value}');" value="{$MOD.LBL_MYLABEL}">',
     

Thanks cherub-chum, Please can you show me how to insert that code. I have


5 => 
	array (
	   'customCode' => '<input type="button" class="button" onClick="window.open(\'index.php?entryPoint=plotsheet&id={$fields.id.value}\');" value="{$MOD.LBL_MYLABEL}">',
	  'sugar_html' => 
	  array (
		'type' => 'submit',
		'value' => 'View Jobsheet',
		'htmlOptions' => 
		array (
		  'class' => 'button',
		  'id' => 'genFile_button',
		  'title' => 'View Jobsheet',
		  'onclick' => 'window.open(\'index.php?entryPoint=plotsheet&id=\'+\'{$bean->id}\');', 
		  'name' => 'View Jobsheet',
		),
	  ),
	),


IS this what you meant?

I have it, Thanks for your help.

5 =>  array ( 'customCode' => '<input type="button" class="button" onClick="window.open(\'index.php?entryPoint=plotsheet&id={$fields.id.value}\');" value="{$MOD.LBL_MYLABEL}">',),