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
zachbarkleyzachbarkley 

SOQL Force.com sites object profile ID

Hello,

Im trying to SOQL query the unique profile ID from the sites object but cannot see any fields on the sites object that indicate a relationship to the related profile object.

The fields available on the site object are:

AdminId
AnalyticsTrackingCode
CreatedById
CreatedDate
DailyBandwidthLimit
DailyBandwidthUsed
DailyRequestTimeLimit
DailyRequestTimeUsed
Description
Id
LastModifiedById
LastModifiedDate
MasterLabel Default
MonthlyPageViewsEntitlement
Name
OptionsAllowHomePage
OptionsAllowStandardAnswersPages
OptionsAllowStandardIdeasPages
OptionsAllowStandardLookups
OptionsAllowStandardSearch
OptionsEnableFeeds
SiteType
Status
Subdomain
SystemModstamp
UrlPathPrefix

The answers on the forum suggest you simply use the UI button "Public Access Settings" (which take you to the profile im a trying to SOQL) to make any changes to the profile, however I cannot see in the database (via Workbench) how this relationship is constructed.

I have been through all the objects to try backward engineer the process but im coming up at dead ends.

How does a site record know which profile record is the unique profile assigned to it for the CRUD permissions.

Any help is appreciated.

Regards

Zach
Vinit_KumarVinit_Kumar
Whenever a user tries to access a Site record,it is always through Site Guest user profile which you can check through 'Public access settings' as you said.

What is the use case here,why do you need to query profile ??