You need to sign in to do that
Don't have an account?
Andrasko
Get Organization details
Hy everyone,
I want to set the organization data (for example: name, city, country) to an input field.
First I try it in visualforce page:
<apex:page standardController="Organization" >
<apex:inputText value="{!$Organization.Name}" />
</apex:page>
But I get the following error message:
Error: Unknown property 'OrganizationStandardController.$Organization'
After that I change the controllert to MyController.
Anyone knows how can I get the Organization data with apex code.
Organization myOrg = [Select o.WebToCaseDefaultOrigin, o.UsesStartDateAsFiscalYearName, o.UiSkin, o.TrialExpirationDate, o.SystemModstamp, o.Street, o.State, o.ReceivesInfoEmails, o.ReceivesAdminInfoEmails, o.PrimaryContact, o.PreferencesRequireOpportunityProducts, o.PostalCode, o.Phone, o.OrganizationType, o.Name, o.MonthlyPageViewsUsed, o.MonthlyPageViewsEntitlement, o.LastModifiedDate, o.LastModifiedById, o.LanguageLocaleKey, o.Id, o.FiscalYearStartMonth, o.Fax, o.Division, o.DefaultPricebookAccess, o.DefaultOpportunityAccess, o.DefaultLocaleSidKey, o.DefaultLeadAccess, o.DefaultContactAccess, o.DefaultCaseAccess, o.DefaultCampaignAccess, o.DefaultCalendarAccess, o.DefaultAccountAccess, o.CreatedDate, o.CreatedById, o.Country, o.ComplianceBccEmail, o.City From Organization o];
That will retrieve you the organization details in Apex Code.
All Answers
Organization myOrg = [Select o.WebToCaseDefaultOrigin, o.UsesStartDateAsFiscalYearName, o.UiSkin, o.TrialExpirationDate, o.SystemModstamp, o.Street, o.State, o.ReceivesInfoEmails, o.ReceivesAdminInfoEmails, o.PrimaryContact, o.PreferencesRequireOpportunityProducts, o.PostalCode, o.Phone, o.OrganizationType, o.Name, o.MonthlyPageViewsUsed, o.MonthlyPageViewsEntitlement, o.LastModifiedDate, o.LastModifiedById, o.LanguageLocaleKey, o.Id, o.FiscalYearStartMonth, o.Fax, o.Division, o.DefaultPricebookAccess, o.DefaultOpportunityAccess, o.DefaultLocaleSidKey, o.DefaultLeadAccess, o.DefaultContactAccess, o.DefaultCaseAccess, o.DefaultCampaignAccess, o.DefaultCalendarAccess, o.DefaultAccountAccess, o.CreatedDate, o.CreatedById, o.Country, o.ComplianceBccEmail, o.City From Organization o];
That will retrieve you the organization details in Apex Code.
Thanks for the quick answer. It's works. :smileyhappy: