0

I have created a detail page button of Custom source as URL that has below URL

/apex/ComplianceIncidentPublish?Id={!Compliance_Incident_abv__c.Id}

That is unable to get hold of ID in the VF page. Can someone help please?

3
  • Are trying to fetch the id in vf page like by getparameterby('id')? Commented Mar 11, 2015 at 8:29
  • 1
    you'll need to post the relevant (and only the relevant - no code dumps please) bits of the corresponding VF page and VF controller (if any)
    – cropredy
    Commented Mar 12, 2015 at 1:54
  • Is Compliance_Incident_abv__c a custom object? If yes & if the detail page button is on the Compliance_Incident_abv__c record itself, then your url should work. If Compliance_Incident_abv__c is a custom lookup or master-detail field then try this /apex/ComplianceIncidentPublish?Id={!Compliance_Incident_abvId__c}
    – Cloud Man
    Commented Oct 27, 2015 at 19:41

2 Answers 2

3

Have you tried using this on the VF page:

{!$CurrentPage.parameters.id}

Or this in your actual APEX:

ApexPages.currentPage().getParameters().get('id');

See VF page param here: https://www.salesforce.com/docs/developer/pages/Content/pages_quick_start_query_params_getting.htm

and ApexPage APEX method here: https://www.salesforce.com/docs/developer/pages/Content/apex_System_ApexPages_currentPage.htm

-1

The parameter you are passing is "Id" and you are checking for "ID"!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .