You need to sign in to do that
Don't have an account?
dai tran 6
Why can't get value of some colums in Custom Object?
Controller:
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?
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?
Check your Force.com Site user profile and grant field level securities to the Profile
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.
But it still not ok.
Why?
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