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
tulikamtulikam 

“Id value is not valid for Topic__c standard controller”

Hello,

when im running the belo code as a system administrator its working fine. But while running the code as a standard platform user its giving me this error. "Id value is not valid for Topic__c standard controller”

Please help me solve this error.

 

my apex class is:

 

public class Topic {

 public Topic(ApexPages.StandardController ctrx)  
 
  { 
         c1=new Topic__c();
         m=new message__c();
        
  
   }
 

The page from which it was redirected:

 

<apex:page StandardController="Topic__c" extensions="Topic" >
<apex:form id="form"  >
<apex:pageBlock >
        <apex:pageBlockSection title="Topics First page"  >
        
             <apex:pageBlockTable value="{!emp}" var="item">

                    <apex:column value="{!item.name}"/>
                    <apex:column value="{!item.description__c}"/>
                    <apex:column headerValue="Action" style="white-space: nowrap">
                        <a href="/apex/post_page?id={!item.id}">Post Message</a>
                    </apex:column>

             </apex:pageBlockTable>
                  
        </apex:pageBlockSection>
    
</apex:pageBlock>
<apex:commandButton action="{!new1}" value="new" >
</apex:commandbutton>

</apex:form>
</apex:page>

 

The page to which it was redirected:-

 

<apex:page standardController="Topic__c" extensions="Topic" >
<apex:form >
   
    <apex:pageBlock >
     
        <apex:pageBlockSection title="New Post Page" columns="1" >
            <apex:outputField value="{!Topic__c.description__c}"/>

            <apex:pageBlockTable value="{!MessageList}" var="item">
                <apex:column value="{!item.text__c}"/>
            </apex:pageBlockTable>
           
            <apex:inputField value="{!m.text__c}"/>
           
            <apex:commandButton value="Save" action="{!save1}"/>
        
        </apex:pageBlockSection>
   
    </apex:pageBlock>


</apex:form>
 
</apex:page>

Best Answer chosen by Admin (Salesforce Developers) 
SSRS2SSRS2

You have to create custom standard platform user by extending standard platform user.

try

 

setup --> Manage Users(Under Administration Setup) --> Profiles --> New

 

Then cloned profile can gives access as you preffered.

-Suresh

All Answers

SSRS2SSRS2

Hello tulika ;

  I think problem is 'Standard Platform User' does not have to access for read and write data for custom object.you can clarify by viewing Custom Object Permissions under 'Standard Platform User'

 

 

 
setup --> Manage Users(Under Administration Setup) --> Profiles --> Standard Platform User

 and press Edit  you can see here 'Standard Platform User' does not have access of  Read,Create,Edi,Delete,View All or Modify All.

 

 

-Suresh

tulikamtulikam

but I cant give those rights to the standard platform user ocz the option is not there.

what to do now??

tulikamtulikam

coz*

SSRS2SSRS2

You have to create custom standard platform user by extending standard platform user.

try

 

setup --> Manage Users(Under Administration Setup) --> Profiles --> New

 

Then cloned profile can gives access as you preffered.

-Suresh

This was selected as the best answer
tulikamtulikam
It worked.. Thank You.. :)
narendharnarendhar

hi

I am new to salesforce, kindly let us know why you have used 'standardconroller' instead of controller.

 

StandardController="Topic__c"

 

kindly tell me the reason