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
dai tran 6dai tran 6 

Why can't get value of some colums in Custom Object?

Controller:
public class AboutController {
 public  List<MyProduct__c> MyProducts {get;set;}
  public AboutController()
  {
       string searchquery='select Product_Code__c,name,price__c,imagename__c  from MyProduct__c '; 
       MyProducts= Database.query(searchquery); 
  }    
}
visual page:
<apex:page controller="AboutController"  >
    <apex:form >
      <apex:pageBlock title="Search Result"> 
             <apex:pageblockTable value="{!MyProducts}" var="a">               
                <apex:column value="{!a.ImageName__c}"/> 
                <apex:column value="{!a.Product_Code__c}"/> 
                <apex:column value="{!a.Name}"/> 
                <apex:column value="{!a.Price__c}"/>                
            </apex:pageblockTable>   
    </apex:pageBlock>
    </apex:form>  
</apex:page>
If i run by url: https://vnittest-dev-ed--c.ap5.visual.force.com/apex/about, It display 4 columns
But if run by Force.com Site url: https://vnittest2-developer-edition.ap5.force.com/demo1/about, it only display 2 columns: Product_Code__c,Name

Why can't get value of some colums in Custom Object?
Raj VakatiRaj Vakati
Check your   Force.com Site  user profile and great filed level securities to the Profile 
Raj VakatiRaj Vakati

Check your   Force.com Site  user profile and grant  field  level securities to the Profile  
 
dai tran 6dai tran 6
User License=Guest, Which is user profile?
grant  field  level securities: I edit in Set Field-Level Security: Select all profiles. but still not ok.
Raj VakatiRaj Vakati
https://developer.salesforce.com/docs/atlas.en-us.workbook_siteforce.meta/workbook_siteforce/siteforce_guest_profile.htm
dai tran 6dai tran 6
Is it Site->Public Access Setting?
In Custom Object Permissions: I select all check box: ReadCreateEditDeleteView All Modify All.
But it still not ok.
dai tran 6dai tran 6
It will display , if i select checkbox Required of field: Always require a value in this field in order to save a record.
Why?
ganesh mamidalaganesh mamidala
First you have to check query in developer console you will get the clarity of your all columns are getting or not.
dai tran 6dai tran 6
Hi, ganesh mamidala
If i run by url: https://vnittest-dev-ed--c.ap5.visual.force.com/apex/about, It display 4 columns
But if run by Force.com Site url: https://vnittest2-developer-edition.ap5.force.com/demo1/about, it only display 2 columns: Product_Code__c,Name
grant  field  level securities: I edit in Set Field-Level Security: Select all profiles. but still not ok.
In Custom Object Permissions: I select all check box: ReadCreateEditDeleteView All Modify All.
It will display , if i select checkbox Required of field: Always require a value in this field in order to save a record.
Why?




 
ganesh mamidalaganesh mamidala
Hi Dia,
Could you please try using datatable as shown in the link below.
https://developer.secure.force.com/cookbook/recipe/building-a-table-of-data-in-a-visualforce-page