• RA
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies

In Winter 12, @remoteAction methods were enhanced to allow "public" methods to be used in Visualforce controllers.  That's great.  I am curious about the profile requirements, though.

 

What I am finding is that, for non-admins, the Controller class needs to be assigned to their profile, but for admins it does not. I was under the impression that having a remote action in the main controller for a page would be enough.  By the user being assigned to the Page, they'd automatically have access to that page's remote action methods, but that doesn't seem to be the case.

 

My main concern is that I am introducing remote actions into a managed package app and it would be likely that my users are not assigned to the controller class in their profile.  I'd like to push upgrade the change so it "just works", but am worried about the side effects.

 

Is the requirement for apex class assignment in the Profile by design or is it a bug? 

  • December 13, 2011
  • Like
  • 0

Hello Salesforce Gurus,

 

Previous issue is resolved: http://boards.developerforce.com/t5/Visualforce-Development/Salesforce-winter-12-Visualforce-issue-crash/td-p/343229

 

But, I am now noticing many other issues with the sandbox salesforce system.

Here are few issues:

1. I get the message like "Stack overflow line 7" when I moved to different pages.

2. When I opened my visualforce page and updated a record, then tried to move to home or any other tab or page, I noticed the URL within the browser is not changing to other pages even though the body within the browser showing other areas. Its weird, and I don't know why system is behaving this way.

(this is happening in the IE Browser)

3. After working with few areas within salesforce, I tried to logout, system hangs out and IE doesn't respond at all. I had to kill the IE many times now.

4. I am also getting this error time to time when I am working within salesforce:

Unable to Process Request We apologize for the inconvenience

The salesforce.com servers are temporarily unable to respond to your request. We apologize for the inconvenience.
Thank you for your patience, and please try again in a few moments.

Visit http://trust.salesforce.com for current system status and availability.

back 

 

Please get back to me and I can share more details if needed.

 

~NK

  • October 05, 2011
  • Like
  • 0

I have a visualforce page which is embedded in the parent page, which displays summary info. This page is working in production salesforce (salesforce11) and its not working in the sandboxes where the (salesforce 12) version is running. Looks like some feature/functionality is broken in the new release.

 

Here is the message I am getting in place of the visualforce container.

=====================================

Content cannot be displayed: java.io.NotSerializableException: common.apex.runtime.bytecode.BytecodeExecutionContext$DynamicContext Path to non-serializable object: ***VF Page Requested: 'pashaquotecharges' Object;@625bcadb[{}] Object;@7863224f[{, , 'j_id0', 'j_id0', 'javax.faces.Button', , , 'j_id0:j_id2', 'j_id2', 'javax.faces.Form', , 'j_id0:j_id2:block', 'block', 'javax.faces.Button', , , 'j_id0:j_id2:block:resultsBlock', 'resultsBlock', 'javax.faces.Button', , , , 'dataCell ', 2, 'totalRow ', 'headerRow ', 'if (window.hiOff){hiOff(this);} ', 'if (window.hiOn){hiOn(this);} ', 'dataRow even , dataRow odd ', 'list ',, 'value', , 'j_id0:j_id2:block:resultsBlock:j_id3:j_id4', 'j_id4', 'org.richfaces.renderkit.CellRenderer', , -2147483648, -2147483648, 'j_id0:j_id2:block:resultsBlock:j_id3:j_id10', 'j_id10', 'javax.faces.Text', 'Terminal Handling', , , 'value', , 'j_id0:j_id2:block:resultsBlock:j_id3:j_id5', 'j_id5', 'org.richfaces.renderkit.CellRenderer', , -2147483648, -2147483648, 'rightalign', 'j_id0:j_id2:block:resultsBlock:j_id3:j_id11', 'j_id11', 'javax.faces.Text', '$203.50', , , 'j_id0:j_id2:block:resultsBlock:j_id6', 'j_id6', 'javax.faces.Button', , , 'j_id0:j_id2:block:resultsBlock:j_id6:j_id7', 'j_id7', 'javax.faces.Label', , 'grandTotalText', 'rightalign', , , 'value', , 'j_id0:j_id2:block:resultsBlock:j_id6:grandTotalText', 'grandTotalText', 'javax.faces.Format', 'width:300px', 'rightalign', , 'j_id0:j_id2:j_id9', 'j_id9', 'javax.faces.Button', , }] Object;@17307a99[{}] Object;@6fc0deb3[{, , 'j_id0:j_id2', 'j_id2', 'javax.faces.Form', , 'j_id0:j_id2:block', 'block', 'javax.faces.Button', , , 'j_id0:j_id2:block:resultsBlock', 'resultsBlock', 'javax.faces.Button', , , , 'dataCell ', 2, 'totalRow ', 'headerRow ', 'if (window.hiOff){hiOff(this);} ', 'if (window.hiOn){hiOn(this);} ', 'dataRow even , dataRow odd ', 'list ', , 'value', , 'j_id0:j_id2:block:resultsBlock:j_id3:j_id4', 'j_id4', 'org.richfaces.renderkit.CellRenderer', , -2147483648, -2147483648, 'j_id0:j_id2:block:resultsBlock:j_id3:j_id10', 'j_id10', 'javax.faces.Text', 'Terminal Handling', , , 'value', , 

  • October 04, 2011
  • Like
  • 0

Hi.

 

I am experiencing the corruption of my JavaScript code when delivered through VisualForce. The code is embedded in my page rather than being held in a separate JS file.

 

The offending section of the original code looked something like this:

<apex:page showHeader="false" sidebar="false"> 
	<script type="text/javascript">
		function SMTInitCheckboxes() 	
		{
			for (var i=0;i<iMax;++i)

 

 

When this gets loaded into the browser I get a JavaScript error. Viewing the code in the browser shows that the text has been modified from my original source:

<script type="text/javascript">
  function SMTInitCheckboxes()  
  {
   for (var i=0;i<iMax className="SMTTRError" ;++i)

 

You can see that ‘className="SMTTRError"’ has magically appeared in the middle of the FOR statement. This is text from much further down the page. I assumed that I had a JavaScript bug and commented out the code but this did not fix the problem.

 

I systematically eliminated all of the VisualForce, HTML and JavaScript until I got the entire page content down to this:

<apex:page showHeader="false" sidebar="false">
<script type="text/javascript">
(i=0;i<iMax;i)
</script>
</apex:page>

The received HTML code (according to FireBug) is as follows. Notice the space between iMax and the semi-colon. The problem is still occurring but only the extra space is being added.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html><head></head><script type="text/javascript">
(i=0;i<iMax ;i)
</script></html>

 

 

I have done the following to try and eliminate the problem with no success:

  • Commented out the JavaScript.
  • Wrapped the JavaScript in CDATA sections.
  • Used different browsers (IE and FireFox).
  • Tried delivering the same content through IIS.

 

Can anyone suggest why my code is being corrupted? It looks like some kind of buffer error in the SFDC parser or page builder but I am hoping it is something that I have screwed up.

I hope to avoid having to move all of my JavaScript into separate JS files simply due to the large number of pages involved.

 

Thanks for your help.

I have a visual force page that was created in Summer 10 in my FCS to update cases.

 

The page allowed the user to change the case status and also create an entry into a customer object and create a case comment all from the same page.

 

It was working perfect in until today.  the only change was my Sandbox was updated to Spring 10.

 

Now whenever I try to update the case from the Visual Force Page I get the following error:

 

System.DmlException: Update failed. First exception on row 0 with id 50030000005o8ETAAY; first error: FIELD_INTEGRITY_EXCEPTION, No selected contact: [ContactId]

 

If I edit the case from GUI I do not get the error.  If I select a contact (Which is not a required field) and then execute the visual force page ot works fine.

 

What has chnaged in Spring 10 that is causing this to happen.

 

Any help is apprciated.

 

 

Here is the page:

 

 

<apex:page Controller="newEnhancemnetController" tabStyle="Case" id="thePage"> <script> function confirmCancel() { var isCancel = confirm("Are you sure you wish to cancel?"); if (isCancel) return true; return false; } </script> <apex:sectionHeader title="New Enhancemnet Approval" subtitle="for change board Case"/> <apex:form > <apex:pageBlock mode="edit"> <apex:pageMessages ></apex:pageMessages> <apex:pageBlockButtons > <apex:commandButton action="{!Save}" value="Save"/> <apex:commandButton action="{!Cancel}" value="Cancel" onclick="return confirmCancel()" immediate="true"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Change Current Case Status" columns="1"> <apex:outputField value="{!Case.id}"/> <apex:outputField value="{!Case.subject}"/> <apex:outputField value="{!Case.description}"/> <apex:pageBlockSectionItem > <apex:outputLabel value="{!$ObjectType.Case.fields.Status.label}" for="casestatus" style="font-weight:bold"/> <apex:outputPanel styleClass="requiredInput" layout="block"> <apex:outputPanel styleClass="requiredBlock" layout="block"/> <apex:selectList value="{!casestatus}" id="casestatus" size="1" title="Status" required="true"> <apex:selectOptions value="{!items}"/> </apex:selectList> </apex:outputPanel> </apex:pageBlockSectionItem> </apex:pageBlockSection> <apex:pageBlockSection title="Add Enhancement Approval Information" columns="2"> <apex:inputField id="eaAprovedFor" value="{!EnhancementApproval.Approved_For__c}" required="true"/> <apex:inputField id="eaEnvironment" value="{!EnhancementApproval.Environment__c}" required="true"/> <apex:inputField id="eaValidFrom" value="{!EnhancementApproval.Valid_From__c}" required="true"/> <apex:inputField id="eaOtherQCS" value="{!EnhancementApproval.Other_QCS__c}" required="False"/> <apex:inputField id="eaValidTo" value="{!EnhancementApproval.Valid_To__c}" required="true"/> </apex:pageBlockSection> <apex:pageBlockSection title="Add a Case Comment"> <apex:inputField id="caseComment" value="{!CaseComment.CommentBody}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>

 

 Here is the controller:

 

 

public class newEnhancemnetController { String casestatus; Case oCase; Enhancement_Approval__c oEnahncemnetApproval; Contact contact; CaseComment casecomment; Map<String,String> mCaseStatus = new Map<String,String>(); public Case getCase() { oCase = [select id, subject, status, description from Case where id = :ApexPages.currentPage().getParameters().get('id')]; if(oCase== null) oCase= new Case(); return oCase; } public Contact getContact() { if(contact== null) contact= new Contact(); return contact; } public String getCaseStatus() { if(casestatus==null){casestatus=oCase.Status;} return casestatus ; } public void setCaseStatus(String casestatus ) { this.casestatus = casestatus ; } public List<SelectOption> getItems() { mCaseStatus.Put('New','New'); mCaseStatus.Put('Approved for Analysis & Design','Approved for Analysis & Design'); mCaseStatus.Put('Reqmts/A&D In Progress','Reqmts/A&D In Progress'); mCaseStatus.Put('Reqmts/A&D Completed','Reqmts/A&D Completed'); mCaseStatus.Put('Approved for Sandbox Build/Config/Test','Approved for Sandbox Build/Config/Test'); mCaseStatus.Put('Sandbox Build In Progress','Sandbox Build In Progress'); mCaseStatus.Put('Sandbox Testing Failed','Sandbox Testing Failed'); mCaseStatus.Put('Sandbox Testing Passed','Sandbox Testing Passed'); mCaseStatus.Put('Waiting for Production Release Date','Waiting for Production Release Date'); mCaseStatus.Put('Release Date Assigned/Approved for Prod','Release Date Assigned/Approved for Prod'); mCaseStatus.Put('Production Testing Failed','Production Testing Failed'); mCaseStatus.Put('Production Testing Passed','Production Testing Passed'); mCaseStatus.Put('On Hold / No Activity','On Hold / No Activity'); mCaseStatus.Put('On Hold / Lack of Funding','On Hold / Lack of Funding'); //mCaseStatus.Put('',''); List<SelectOption> options = new List<SelectOption>(); Schema.DescribeFieldResult fieldResult = Schema.sObjectType.Case.Fields.Status; fieldResult = fieldResult.getSObjectField().getDescribe(); List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues(); for( Schema.PicklistEntry f : ple) { if (mCaseStatus.containskey(f.getValue())) options.add(new SelectOption(f.getLabel(), f.getValue())); //options.add(new SelectOption(f.getLabel(), f.getValue())); } return options; } //public List<SelectOption> getItems() { // List<SelectOption> options = new List<SelectOption>(); // for (CaseStatus cs : [Select MasterLabel from CaseStatus order by sortorder]){ // options.add(new SelectOption(cs.MasterLabel,cs.MasterLabel)); // } // return options; //} public CaseComment getCaseComment () { if(casecomment== null) casecomment= new CaseComment(); return casecomment; } public Enhancement_Approval__c getEnhancementApproval() { if(oEnahncemnetApproval== null) oEnahncemnetApproval= new Enhancement_Approval__c(); return oEnahncemnetApproval; } public PageReference cancel() { PageReference casePage = new ApexPages.StandardController(oCase).view(); casePage .setRedirect(true); return casePage ; } public PageReference Save() { if (oEnahncemnetApproval.Environment__c == 'QCS - Other' && oEnahncemnetApproval.Other_QCS__c ==Null ){ ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR,'Other QCS is Required when Environment is equal to "QCS - Other"'); ApexPages.addMessage(myMsg); return null; } oCase.Status=this.casestatus; update oCase; Enhancement_Approval__c oEA; oEA = new Enhancement_Approval__c(); oEA.Approved_For__c = oEnahncemnetApproval.Approved_For__c; oEA.Case__c = ApexPages.currentPage().getParameters().get('id'); oEA.Environment__c = oEnahncemnetApproval.Environment__c; oEA.Valid_From__c = oEnahncemnetApproval.Valid_From__c; oEA.Valid_To__c = oEnahncemnetApproval.Valid_To__c; oEA.Other_QCS__c = oEnahncemnetApproval.Other_QCS__c; insert oEA; if (casecomment.CommentBody != null){ casecomment.ParentId = ApexPages.currentPage().getParameters().get('id'); insert casecomment; } PageReference casePage = new ApexPages.StandardController(oCase).view(); casePage.setRedirect(true); return casePage ; } //*************************************************************************** //** Test Method //** //*************************************************************************** public static testMethod void testChangeBoardApproval() { pageReference p = Page.ChangeBoardApproval; p.getParameters().put('id', [select id from Case limit 1].id); test.setCurrentPage(p); newEnhancemnetController enhancmenetController = new newEnhancemnetController(); //enhancemnetController.cancel(); enhancmenetController.getCase(); enhancmenetController.getitems(); enhancmenetController.getcasestatus(); enhancmenetController.getEnhancementApproval(); enhancmenetController.getContact(); enhancmenetController.getCaseComment(); enhancmenetController.save(); } }

 

 

 

 

 

  • January 25, 2010
  • Like
  • 0