• neeraj87
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies
I have a vf page which I want my public site to display. The problem here is when I open the page it gives me "Authorization Required" error.

Now before you go ahead and vote down this question, here are a bunch of things I researched and did before posting it here.

1) I compared an old site setup for another client (where the vf page works) with the one I am doing now and the problem seems that the new setup has a different Site Type.

Site where vf pages work
Site where vf pages work

Current site where the vf page is not working
User-added image

2) I also checked the Public Access Settings for my non working site and it seems that all the required read access are there for custom objects being used in the site vf pages and their controllers.

3) The vf pages were also enabled for the site.

4) Another thing I noticed is that the working site has user license as Guest License, whereas the non working site has user license as Guest.

But when I am creating a site, it does not give me any option to choose the license type for the guest and just puts in Guest. From what I know Guest License and Guest are not the same.

How do I change the user license type for the site guest user? Or am I setting the site incorrectly?

I referred these links for site setup but it did not help me much: https://developer.salesforce.com/page/An_Introduction_to_Force.com_Sites https://help.salesforce.com/HTViewHelpDoc?id=sites_configuring_sites.htm&language=en_US

PS: Ok so I replaced my vf page with a test page and it still gives me the same authorization error message

Is it possible to change the current system language (Language Settings) from an Apex controller of a public facing vf page? We are creating a configuration menu on a vf page where the user can change the current default system language.

There is a drop down for languages in the vf page from where the user selects his language. I looked into LanguageLocaleKey and I was able to change the current language by querying user and setting different language.

 

This is sample code i created as proof of concept:

 

<apex:page controller="LanguageChangeTestController">
 
  Current system language : <apex:outputText value="{!currentLanguage}"/>
 
  <apex:form >
      <apex:commandButton value="Change language to Portuguese" action="{!changeLanguage}"/>
      <apex:commandButton value="Go back to US English" action="{!goBackToUSEng}"/>
  </apex:form>
 
</apex:page>

 

 

public with sharing class LanguageChangeTestController {

    public String currentLanguage {get; set;}
    
    public LanguageChangeTestController() {
        currentLanguage =  UserInfo.getLanguage();
    }
    
    public void changeLanguage() {
        //get current user
        String currentuserId = UserInfo.getUserId();
        User currentUserInfo = [select LanguageLocaleKey from User where Id = :UserInfo.getUserId()];
        currentUserInfo.LanguageLocaleKey = 'pt_BR';
        update currentUserInfo;
    }
    
    public void goBackToUSEng() {
        User currentUserInfo = [select LanguageLocaleKey from User where Id = :UserInfo.getUserId()];
        currentUserInfo.LanguageLocaleKey = 'en_US';
        update currentUserInfo;
    }
}

 

However I am not sure if I can access user id from the public facing vf page.

 

Any idea on how this will work for a public facing vf page?

I need to override the css styling of the user profile page. The overriding of css is mostly stuff like changing page background color from blue to red, changing page font to Verdana 9pt etc. I have already done sfdc css overriding using custom component with custom css attached to the left sidebar. See following image for example.

 

However few of the sfdc pages in the org do not have left sidebar or right side bar div's, like chatter, user profile etc. I want to know if anyone has ever tried customizing css for these pages.

 

Another solution that I can think of is creating vf pages for showing user profile and redirecting the user to that vf page instead of the standard user profile page, but I dont know how this can be achieved or is it even possible.

Help is much appreciated.

I have created a custom object (Template_Information__c)  with rich text custom field (RichTextArea__c). I am reading the rich text in my vf page as follows:

 

<apex:page id="pageid" controller="SelectTemplateController">

 

     <!-- Add the javascript file to intialize the CkEditor -->
     <apex:includescript value="{!URLFOR($Resource.CkEditor, 'ckeditor/ckeditor.js')}" />

     <apex:form id="formid">

    <apex:commandButton action="{!redirectToTemplate}" value="Go to template" reRender="rich"/>


    <apex:inputTextarea id="inputid" value="{!templateInfo.RichTextArea__c}" styleClass="ckeditor" richText="false"/>

      </apex:form>


</apex:page>

 

At the controller side:

 

public with sharing class SelectTemplateController {

public Template_Information__c templateInfo {get; set;}

public SelectTemplateController() {
templateInfo = new Template_Information__c();

}

public Pagereference redirectToTemplate() {


insert templateInfo;
System.debug('OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO templateInfo.Id : ' + templateInfo.Id);
}


}

 


The issue is, the object is saved but when I do a query to fetch the RichTextArea__c it returns null. 

 

From what I have seen, this issue is due to the ckeditor. If I remove the styleClass="ckeditor" from the inputtextarea tag, the entered content is saved properly. 

 

Has anyone worked with the ckeditor before? 

I do not understand whay the content from the editor does not get saved in the rich text custom field.

 

Thanks.

Hi All,

 

I have a page (MyTestPage) containing my custom component (MyComponent). What I want to do is repeat this component on this page. Something like below.

 

<apex:page controller="MyPageController">
<apex: repeat ....>
 <c: MyComponent/>
</apex:repeat>
</apex:page>

 Is there any way to repeat a custom component using repeat? I have seen the documentation and so far I could not find any examples where a custom component was repeated on a page using repeat.

 

I am new to Salesforce so my idea might be wrong. In any case please let me know.

 

Thanks for the help.

 

 

I have created a custom object (Template_Information__c)  with rich text custom field (RichTextArea__c). I am reading the rich text in my vf page as follows:

 

<apex:page id="pageid" controller="SelectTemplateController">

 

     <!-- Add the javascript file to intialize the CkEditor -->
     <apex:includescript value="{!URLFOR($Resource.CkEditor, 'ckeditor/ckeditor.js')}" />

     <apex:form id="formid">

    <apex:commandButton action="{!redirectToTemplate}" value="Go to template" reRender="rich"/>


    <apex:inputTextarea id="inputid" value="{!templateInfo.RichTextArea__c}" styleClass="ckeditor" richText="false"/>

      </apex:form>


</apex:page>

 

At the controller side:

 

public with sharing class SelectTemplateController {

public Template_Information__c templateInfo {get; set;}

public SelectTemplateController() {
templateInfo = new Template_Information__c();

}

public Pagereference redirectToTemplate() {


insert templateInfo;
System.debug('OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO templateInfo.Id : ' + templateInfo.Id);
}


}

 


The issue is, the object is saved but when I do a query to fetch the RichTextArea__c it returns null. 

 

From what I have seen, this issue is due to the ckeditor. If I remove the styleClass="ckeditor" from the inputtextarea tag, the entered content is saved properly. 

 

Has anyone worked with the ckeditor before? 

I do not understand whay the content from the editor does not get saved in the rich text custom field.

 

Thanks.

Hi All,

 

I have a page (MyTestPage) containing my custom component (MyComponent). What I want to do is repeat this component on this page. Something like below.

 

<apex:page controller="MyPageController">
<apex: repeat ....>
 <c: MyComponent/>
</apex:repeat>
</apex:page>

 Is there any way to repeat a custom component using repeat? I have seen the documentation and so far I could not find any examples where a custom component was repeated on a page using repeat.

 

I am new to Salesforce so my idea might be wrong. In any case please let me know.

 

Thanks for the help.