0

I created a VF and a controller to edit few fields on case object. It is working fine when I preview it and pass the case Id, But when I open it from the site the input texts are gone. I am able to display the data but from but wherever there was input of any kind it has disappeared. I checked the field level security but is there anything different for Case object that needs to be done to make its fields visible to guest users.

public without sharing class Case_Verify_Email {
public String urlId{get;set;}    
public List<Case> cs {get;set;}

public Case_Verify_Email(){    
    this.urlId = ApexPages.currentPage().getParameters().get('id');
    Case c = [Select PickupLocationId__r.id from Case where Id=:urlId];
    cs = new List<Case>();
    cs = [Select id, CaseNumber,Status,Phone_Number__c,Vehicle_ready_for_pick_up__c, Vehicle_Runs__c, Reason_Vehicle_is_not_running__c,
         Vehicle_has_keys__c, Will_they_be_making_keys__c, Address_Verified__c, Different_Address__c,
         Pickup_Address__c, Pickup_City__c, Pickup_State__c, Pickup_Zip__c  
         from Case where PickupLocationId__r.id =: c.PickupLocationId__r.id AND Status != 'Closed'];

}

public PageReference Submit(){               

    update cs;

    PageReference pageRef = new PageReference('/apex/VVThankYou');
    pageRef.setRedirect(true);
    return pageRef;
}

}  
  <apex:page controller="Case_Verify_Email">
<apex:form >
    <apex:pageBlock >                          
                <apex:repeat value="{!cs}" var="c">
                <table>
                <tr>
                    <td>
                    Case No : {!c.CaseNumber}
                    </td>
                </tr>
                <tr>
                    <td>
                        Please Verify that the vehicle is at your address {!c.Pickup_Address__c}, {!c.Pickup_City__c}, {!c.Pickup_State__c}, {!c.Pickup_Zip__c}
                        <br/> If not what address
                    </td>
                    <td>
                        <apex:inputField value="{!c.Address_Verified__c}"/>
                        <br/> <apex:inputField value="{!c.Different_Address__c}"/>
                    </td>                      
                </tr>
                <tr>
                    <td>
                        Vehicle has keys ?
                        <br/>If not will you be making keys    
                    </td>
                    <td>
                        <apex:inputField value="{!c.Vehicle_has_keys__c}"/>
                        <br/><apex:inputField value="{!c.Will_they_be_making_keys__c}"/>
                    </td>

                </tr>
                <tr>
                    <td>
                        Vehicle Runs?
                        <br/> If not what is wrong
                    </td>
                    <td>
                        <apex:inputField value="{!c.Vehicle_Runs__c}"/>
                        <br/><apex:inputField value="{!c.Reason_Vehicle_is_not_running__c}"/>
                    </td>                                              
                </tr>
                <tr>
                    <td>
                        Is this vehicle ready to be picked up
                    </td>
                    <td>
                        <apex:inputField value="{!c.Vehicle_ready_for_pick_up__c}"/>
                    </td>
                </tr>
                <br/><br/>
                </table>
                </apex:repeat>                                        
        <apex:commandButton action="{!Submit}" value="Submit"/>
    </apex:pageBlock>
</apex:form> 

  • Could you share your code? I guess you have already enabled FLS for guest user's profile. Try using custom controller in without sharing mode. – Raul Oct 31 '17 at 10:48
  • @RahulSharma Tried without sharing as well still the same – Afroz Kazi Oct 31 '17 at 10:52
  • @RahulSharma added the controller – Afroz Kazi Oct 31 '17 at 10:54
  • @RahulSharma added – Afroz Kazi Oct 31 '17 at 11:07
  • You've checked the object CRUD permissions also? – David Cheng Oct 31 '17 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.