+ Start a Discussion
Karunkar VlabsKarunkar Vlabs 

Build URL For custom list button Urgent

Hi pls help
i ve custom button like 'crete task' on lead, account, contact and opportunity detail page..
in button url, i need to pass all 4 above with respectively click on detail page.
if it is lead page(id Start with '00Q') pass lead id
if it is opportunity page(id Start with '006') pass opportunity id
For this i need url with if conditions..

Thanks in advance
Sampath KumarSampath Kumar
Hi Karunkar,

Suppose if you have custom button as following on lead
<apex:commandButton action="your action goes here">
<apex:param value="{!$currentPage.parameters.id}" assignTo="{!variableInController}"/>

In controller you can use public Id variableInController{get;set;}

So, you can have respective id's in controller.

Use the same command button for all the detail pages.

Let me know if you have any queries, if not mark this answer as best answer.

Sampath Kumar Goud

Karunkar VlabsKarunkar Vlabs
Thanks Sampath Kumar
Sampath KumarSampath Kumar
Hi Karunakar,

Mark this as best answer if this solves your quer,  to make this community clean and re-usable.

Sampath Kumar Goud