• Brandon Feather
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
While working on a new jsRemote based VisualForce page I have been getting some random errors. The setup is as followed:

I have a public class that is the main controller for a VisualFoce Page. In this VisualForce page I have multiple Extentions that implement a RemoteAction. I call the RemoteAction from my javascript to fill the page with data. Now, this all works like a charm. The page loads, it gets the data and then builds the HTML on the page.
public with sharing class ExampleClassExt {
    public ExampleClass (ExampleHome ctl){ }
    
    @RemoteAction
    public static list<CustomObject> body(String employeeId) {
    }
}
 
Visualforce.remoting.Manager.invokeAction(  
	 "c.ExampleClassExt.body",
	 Employeeid,
	 function(result,event){
	   if(event.status){  
             doStuff();
           }
         });

Now the error shows up when I change something in the Apex code, either in the controller or one of the Extentions and shows up like this:
 
Apex script unhandled exception by user/organization: 00xxxxxxx/00Dxxxxxxxxx
 
Visualforce-pagina: /apex/c__ExampleHome

caused by: line 8, column 40: Public remoted methods not allowed in global components


The weird thing is that this error shows up sometimes even after only changed a space or something else small. This error keeps showing up, just untill I reupload the VisualForce page. After that, it works immediately and the error is gone. As you can see, I have no Global classes or Public classes and its all run from Salesforce itself. The odd thing is that the moment I recompile/reupload the VisualForce page everything is working again.

Has anyone seen this error before? And perhaps know where I'm doing things wrong? 
 

I am cereating a button that will create a new task.  Is there a way to default the 'Due Date' to Today and also have the record automatically save?  I am using 'tsk4' to try and default due date but its not working. Here is my code.  Thanks

 

https://na5.salesforce.com/00T/e?who_id={!Account.Id}&what_id={!Opportunity.Id}
&RecordType=012700000005jvM&ent=Task
&tsk1_lkid={!Opportunity.OwnerId}
&tsk1={!Opportunity.OwnerFullName}
&tsk4 ={!TODAY()}
&tsk12=Completed
&tsk5=Call
&00N70000002OQDq=Left Message
&tsk6=Left Message
&Save=X