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

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');
  }
  ...
  • Thanks @sfdcfox. i was getting error because of id parameter which is resolved now. – Snehal Gaware Feb 7 at 4:43

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.