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
vibrationvibration 

value {!Sprint__c.id} is not valid for the Sprint__c standard controller





public with sharing class CreateSPrintBacklogContExt_1 {

       public List<Backlog__c> sblogs {get; set;}

public final Sprint__c parSprint;     
       public  Request__c StartDate{get;set;}
       public  Request__c EndDate{get;set;}

 public CreateSPrintBacklogContExt_1(ApexPages.StandardController myController) {
    
     
       StartDate =  new Request__c();
       EndDate =  new Request__c();     
       parSprint=[Select ID,Name,Project__c,Release__c  from Sprint__c  WHERE ID = :((Sprint__c)myController.getrecord()).ID];           
       sblogs = new List<Backlog__c>();
       Backlog__c SBacklog = new Backlog__c();      
       SBacklog.Sprint__c = parSprint.Id;             
       sblogs.add(SBacklog);     


  public PageReference Insertbacklog() {
Insert sblogs;
PageReference parrec = new PageReference('/apex/CreateBacklogs?id={!Sprint__c.id}');
 parrec.setRedirect(true);
return parrec;
}





error :Id value {!Sprint__c.id} is not valid for the Sprint__c standard controller

Best Answer chosen by Admin (Salesforce Developers) 
HariDineshHariDinesh

Hi,

 

You can't pass some value like that. It wll treate that as string.

 

PageReference parrec = new PageReference('/apex/CreateBacklogs?id='+someid);

 

Here get the Id into string of something, before this statement and use that valriable like as shown.

Here someid is my variable which contain the ID value. 

 

All Answers

HariDineshHariDinesh

Hi,

 

You can't pass some value like that. It wll treate that as string.

 

PageReference parrec = new PageReference('/apex/CreateBacklogs?id='+someid);

 

Here get the Id into string of something, before this statement and use that valriable like as shown.

Here someid is my variable which contain the ID value. 

 

This was selected as the best answer
vibrationvibration

Thank you very much.