Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have created a site in which I need the update the existing record values in Case object,which as three sections. The first two section are read only and in third we need to update the values. I can able to edit and update the value in vf page but when it come to site i am getting the third section also in read only mode, i can't able to edit or update the fields.

Image1 is VF page:enter image description here

Image 2 is Site:enter image description here

Apex Class:
public class Bigw_Noshow_Update
{    
       public List<Case> case_update;

    public Id caseId {get;set;}
    public Case cases {get;set;}
  public Case case_record{get; set;}
    public String recordID {get; set;}
     public PageReference pr{get;set;}
   /* public Bigw_Noshow_Update(ApexPages.StandardController controller) 
    {

    }*/
    public Bigw_Noshow_Update(ApexPages.StandardController controller)
    {
    cases =new Case();
    recordID = ApexPages.CurrentPage().getparameters().get('id');
   List<case>  case_record= [SELECT Id,Full_Name__c, Resolution__c,Email_Address__c, Reason__c, Response_Status__c,Resolution_Comments__c FROM Case WHERE id=:recordID LIMIT 1];

    system.debug('****'+recordID);
    //fetchAccountDetails();
    }
     public pageReference updates()
    {
        update case_record;

        pr = new PageReference('/'+recordId);
        pr.setRedirect(true);
        return pr;
    }

    }
VF Page

<apex:page standardController="Case" extensions="Bigw_Noshow_Update" showHeader="false" sidebar="false">

<apex:form >
 <apex:pageBlock >
 <apex:pageBlockSection columns="2" title="Case Information">
  <apex:outputField value="{!case.Full_Name__c}" />
  <apex:outputField value="{!case.Email_Address__c}" />
  <apex:outputField value="{!case.Priority}" />
  <apex:outputField value="{!case.Origin}" />
  <apex:outputField value="{!case.Status}" />
  <apex:outputField value="{!case.Subject}" />
  <apex:outputField value="{!case.Number_Pallets_Cartons__c}" />
  <apex:outputField value="{!case.Description}" />
  <apex:outputField value="{!case.Event_Number__c}" />
  <apex:outputField value="{!case.XD_FD__c}" />
  <apex:outputField value="{!case.Type}" />
  <apex:outputField value="{!case.Resolution_Comments__c}" />
   </apex:pageBlockSection>
 <apex:pageBlockSection title="PO Information" >

  <apex:outputField value="{!case.PO__c}" />
  <apex:outputField value="{!case.ContactId}" />
  <apex:outputField value="{!case.Distribution_Centre__c}" />
  <apex:outputField value="{!case.Vendor_Number__c}" />
   </apex:pageBlockSection>
 <apex:pageBlockSection title="Other Information">  
  <apex:inputField value="{!case_record.Resolution__c}" />
  <apex:inputField value="{!case_record.Reason__c}" />
   <apex:inputField value="{!case_record.Resolution_Comments__c}" />

 </apex:pageBlockSection>
<!--<apex:repeat value="{!case_record}" var="c">
                               <apex:inputField value="{!c.Resolution__c}"/>
                                <apex:inputField value="{!c.Response_Status__c}"/>
                                <apex:inputField value="{!c.Resolution_Comments__c}"/>


</apex:repeat>-->

             <apex:pageBlockButtons location="bottom">

 <apex:commandButton value="Update" action="{!updates}"/>
  <apex:commandButton value="Cancel" action="{!cancel}"/>

             </apex:pageBlockButtons>

 </apex:pageBlock>
 </apex:form>

</apex:page>
share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

enter image description here

The case can be edited from Guest Profile and Hence I fear it's not possible to update records of case using InputField atleast

workaround to use InputText as below using getter setter property

<apex:inputtext value="{!reason}" label="Reason" />
<apex:inputtext value="{!resolution}" label="Resolution"/>
<apex:inputtext value="{!resolution_comments}" label="Resolution Comments"/>

 public string reason{get;set;}
 public String resolution{get;set;}
 public String resolution_comments{get;set;}

And then do small mapping as below

public pageReference updates(){

    case_record.Reason__c=reason;
    case_record.Resolution_Comments__c=resolution_comments;
    case_record.Resolution__c=resolution;

    update case_record;
    pr = new PageReference('http://devperi-woolworths.cs18.force.com/? id='+recordId);
    pr.setRedirect(true);
    return pr;
}
share|improve this answer
    
Thank you verymuch. Its working fine. –  Udaya Mar 6 at 6:55
add comment

You need to check your field permissions. On the Site, there's a button to edit the profile that the Site uses; you need to make sure that the field is set as Visible and not set as Read Only. Also ensure that the object itself is also visible under the Object permissions.

share|improve this answer
    
thanks for replay i have checked public access setting that field is set as visible and object level. –  Udaya Mar 6 at 6:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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