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
TomSnyderTomSnyder 

fields.getMap() does not return standard fields in Sites

 If I do a MySObject.GetSObjectType().getDescribe().fields.getMap() in anon block or in non-Sites VF page it will return all the field, 

 

BUT if i run the same VF page in Sites it wont return the standard fields... only the custom.   

 

Does anyone know why or what the workaround would be?

 

-Tom

 

reproduce:

 

public class reproduce_getMap { public string s {set;get;} public reproduce_getMap() { sobject q = new Account(); Map<String, SObjectField> flds = q.GetSObjectType().getDescribe().fields.getMap(); s=joint(flds.keyset(),','); system.debug(s); } //////////////////////////////////////////////////////////////////////////////////////////// private static string joint(SET<String> alist, String delim) { String out=''; for (String s :alist) out+=s+delim; return (out.length()>0) ? out.substring(0,out.length()-(delim.length())) : out; } }

 


<apex:page controller="reproduce_getMap"> {!s} </apex:page>

 


 

TomSnyderTomSnyder

UPDATE:

 

As of 3/4/10 the sample code in my last post will not return ANY fields on Sites,  (On 3/3/10 it would only return custom fields).

 

Also it has been determined that by making the object visible on the site users profile would fix this issue

(Unfortunately, this is a workaround that I cannot allow in my case)

 

There has definitely been some changes (at least on our Sandbox) on what context is used for this describe,  I sure hope it is a temp change...otherwise I'll be forced to keep a copy of this metadata is an sobject,  and have it updated via a batch job.

 

Anyone out there have any insight on this change?  I put in a case waiting for a response from SF too.

 

 

Message Edited by tesii on 03-05-2010 08:23 AM