I have created a custom conversion process that uses Visualforce. There is a custom button on the Lead page for conversion. I want that same button on Campaign Members that need to be converted, but that button is not there and when I tried to create a custom button connected to the Lead Convert VF page, no options for VF show up. To get around that I used "Inspect Element" on the lead convert button and converted it from HTML to Javascript. I would like this to work on any campaign member. The code I have technically works but for some reason when I click convert it sends me to a page with a convert button and when I click that it brings me to the custom conversion screen. I would like to get rid of the page with the convert button, because the button on Campaign Members layout should bring you directly to the conversion page. I think my button is written for a specific lead. How can I make sure it works on all? Am I going about this the right way? My code is below.
document.write("<input value=\"Convert\" class=\"btn\" title=\"Convert\" name=\"convert_lead\" onclick=\"navigateToUrl('https:\/\/c.cs11.visual.force.com\/apex\/leadConvertPage?scontrolCaching=1&id=00QZ0000008XRwq','DETAIL');\" type=\"button\">");