How do I get this to show on the customer details tab for companies

  • 8 November 2016
  • 4 replies
  • 54 views


<div id="edit_ticket_toolbar"></div>


<script type="text/javascript">


  jQuery('#edit_ticket_toolbar').closest('.widget').removeClass('widget'); // Hide widget from sidebar


  jQuery(document).on("ticket_view_loaded", function(event, data) {


    var obj_target = jQuery('#watcher_toggle').parent();


    jQuery('<li class="ticket-btns"><a class="btn info" id="edit_ticket_btn_toolbar" title="Client Details" href="http://www.docs2data.co.za">Client Details</a></li>').insertBefore(obj_target);


  });


</script>



This topic has been closed for comments

4 replies


Hi Fareen,




Please use the below script.

<script type="text/javascript">


jQuery(document).ready(function(){
if(
page_type == "contact"){


jQuery("<a href='http://www.docs2data.co.za' class='btn'>Client Details </a>").prependTo(".btn-group.pull-right");


}
});
</script>

Regards


Jerry





Hi Jerry




Thank you, you are awesome!




Could I apply the same to a company contact? by changing the page_type?




If it is possible please let me know what the page type would be for a company.




Thanks again



Hi Again, is it possible to get the contact name from this page and use it as a variable in a url?




The link goes to an online form and I want to try prepopulate some field/s with values in this contact record




i.e.


jQuery("<a href='http://www.docs2data.co.za/forms/formfield=contactname'class='btn'>Client Details </a>").prependTo(".btn-









Hi Again




I would also like to add a variable at the end of the URL.




The link goes to a form and I would like to pre-populate this form via url with values from the contact record in freshdesk




i.e. <a href='http://www.docs2data.co.za/my_form?form_field="ContactName"




I can use a placeholder from a ticket but how do I do it from the contact page?