Hi Team,
Can some one suggest us the way to add custom button next to SAVE, CANCEL Any module and custom Module.
Also please suggest how can we write some custom on the click of the button.
Regards,
Deepak
Hi Team,
Can some one suggest us the way to add custom button next to SAVE, CANCEL Any module and custom Module.
Also please suggest how can we write some custom on the click of the button.
Regards,
Deepak
Hi Ramana,
Thanks for your reply.
It is little confusing for me.
I am attaching the screen shot where i want to add custom button for your better understanding.
Can you suggest more examples.
Regards,
Deepak
Hi Parag Mittal
Okay, you are using sugar 6.x.
custom/modules/Accounts/metadata/editviewdefs.php and add this code:
'templateMeta' =>
// Add this code
array (
'javascript' => '
<script src="./include/javascript/jquery.min.js" type="text/javascript"></script>
<script src="./custom/include/javascript/test.js" type="text/javascript"></script>
',
),
array (
'buttons' =>
array (
0 => 'SAVE',
1 => 'CANCEL',
// Add This code
2 =>
array (
'customCode' => '<input id="MyButton" title="My Button" class="button" type="button" name="MyButton" value="My Button" onclick="myButtonFunt();">',
),
),
Now in your custom/include/javascript/test.js file write all your script code to do so:
$(document).ready(function(){
function myButtonFunt(){
console.log("Hi Friends am Triggered..");
}
});
Once check with this approach and let me know if you found any issues.
Hope this Helps
Best Regards
S Ramana Raju
Hi Ramana,
Thanks for the Reply.
Just a though, all above code should not be the part of Extension folder as it is custom code?
It may cause issues with other customization.
Or frame work will take care of it.
Regards,
Deepak