• BruceVBuren
  • 0 Points
  • Member since 2011

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 4

There are a few posts on this issue about CMSForce 2 , so I thought I would start a new post with the workaround i have devloped.


In CMSForce 2,

  • if you have a class and set in the URL Rewriter Class in your sites configuration  (friendlyURL) and
  • add a web form to a page  and
  • run the page and press the save button you receive a
  • page not found:page error.
  • However when using the preview of the webForm (from the webform detail page), the form works fine.

Why this happens seems to be the dynamic nature of the page construction or the use of components.   Salesforce is confused as to what controller it needs to post back to or something like that. -whatever...


The work around is as follows:

  • Add a height field to the WebForm object
    • Go to setup > Create > objects > web form
    • Add a field called Height and include it on the webform layout  (actually you will need to update the WebFormEditor).
    • Create a component called RenderFormPage and paste the following code:
      • Setup>Develop>Components

<apex:component >



    .xframe { width:100%; }



  <apex:attribute name="formId"

               description="id of the Web Form to render"

               type="string"  required="true"    />

        <apex:attribute name="formHeight"

                description="the general height of the form" type="string"

                required="true"    />   

        <iframe src="{!$Site.CurrentSiteUrl}form?id={!formid}"

                id="{!formid}" class="xframe"

                height="{!formHeight}px"  >




  • Update the contentblock component replacing the web form render code with the following:
    • Setup>develop>components>contentblock

        <!-- Render a Web Form -->

        <apex:outputPanel rendered="{!item.Type__c == 'WebForm'}"  >

<c:RenderFormPage formId="{!item.Web_Form__c}"  formHeight="{!item.Web_Form__r.Height__c}" />


  • In the form.page add the following script


     if( ("{!returnUrl}").length > 0 )



  • In the FormController add this property:

    public string returnUrl {get;set;}

  • And In the form controller add this to the end of the SaveObject – if(valid)  code block and comment out the return pr

          returnUrl =  retUrl;       

          // return pr;


Basically, we stop using the renderfrom component and instead we create a component renderFormPage that renders the web form.page inside an iframe. 


We update the web form.page and controller with some javascript and a property so that the return URL works properly.


Because the iframe does not know about its content size we need to set the height manually and do that through the height property added on the webform object .


You may need to add your custom CSS links to the form.page component as it no longer in the Dom.


Hope this helps





Hi All,


I am using CMSForce to build content of one of my current sites and am also using a URL rewriting class. The issue I am having is when using the submit button on a webform page, or calling any pagereference method, the URL rewriter class is called first and the method to save the form never gets executed. Has anyone run into similar issues using URL rewriter, and if so - have you found any workarounds? I appreciate any help with this!


This error appears with increasing frequency:



Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary



Unfortunately, I never have any information indicating why it has happened. I am logged in as the System Administrator and I should have access to everything.


Perhpas this message also appears when a managed package throws an error?

I just deployed code last week without a problem.  When I run all tests in the sandbox, I get 85% coverage and no errors.  However, when I try  to deploy anything from my sandbox, I get the following error on 3 of my test classes:


System.DMLException: Insert Failed. First Exception on row 0; first error; Duplicate_Username, Duplicate Username, <br> Another user has already selected the username <br> Please selectd another: [Username]


Each test class does create a user object and even though I have deployed these before without problem, I modified so they hae a differeint email address.... However I still cannot deploy.


I don't believe I have made any changes to the live org but I cannot deploy... any ideas? thanks!!!



I just installed CMSForce in development as a trail before I go forth with production...

The first 6 steps of the installation process are concerning. We have way too many documents, dashboards, letterheads, workflows etc that we already have set up in Salesforce. I do not want any existing settings changed that would impact their current function.  Can you verify before I install to production? Thanks!

  1. Change the visibility settings for any installed documents, reports, dashboards, letterheads, email templates, and custom fields on standard objects. By default, these components are visible to all users. Set the Running User for any installed dashboards or analytic snapshots; by default, it is set to you.
  2. Set the Running User for any installed dashboards or analytic snapshots; by default, it is set to you.
  3. Specify the appropriate recipients for any installed workflow tasks.
  4. Specify the appropriate assignees for any installed workflow alerts.
  5. Specify the appropriate user for workflow field updates that modify the Owner field or user lookups; by default, it is set to you.
  6. Create a schedule for any installed analytic snapshots.
  7. Configure any additional settings for this package from the package detail page.
  8. Deploy the package by clicking Deploy Now below. You can also do this at any time in the future from the package detail page.