0

I have created a list button which is mapped to vf page /apex/NewProblem, This button i made visible on case related list of problem object. enter image description here

So whenever i remove the id from button url it is showing vf page as given below but issue is when i pass case id into url it is giving me error as "Id value 5001q00000174vD is not valid for the SC_Problem_Management__c standard controller" . I am passing this value because it should appear on Case field of vf page. But it is not doing so, i have tried many times to resolve it facing same issue again and again.

vf page snap: enter image description here

1 Answer 1

0

You'll need to arrange for a different variable to be used. The id parameter is always reserved for the standard controller.

URL

/apex/NewProblem?caseId={!Case.Id}

Page

<apex:page standardController="SC_Problem_Management__c" extensions="PM_Controller" ...

Controller

public with sharing class PM_Controller {
  ApexPages.StandardController sc;
  public PM_Controller(ApexPages.StandardController con) {
    sc = con;
    SC_Problem_Management__c record = (SC_Problem_Management__c)con.getRecord();
    record.Case__c = ApexPages.currentPage().getParameters().get('caseId');
  }
  ...
1
  • Thanks @sfdcfox. i was getting error because of id parameter which is resolved now.
    – Snehal
    Feb 7, 2019 at 4:43

You must log in to answer this question.

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