function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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
etc...,
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}"/>
</apex:commandButton>

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.

Regards
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.

Regards
Sampath Kumar Goud