• MWorldMM
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 9
    Replies

We have Javascript Remoting in use in our Production instance (Summer '11) and it works like a charm. Our Sandbox was just "upgraded" to Winter 12 and now we are getting reference errors on code that has not changed in 2 months. What gives?

Our client needs us to dump records from several large related objects into PDFs for archival use. These PDF's are then saved as record attachments in a custom object named Snapshot. The PDF's generate with no problem as long as the nuumber of records involved is below a certain number. Beyond that point we get the following error on screen:

Time limit exceeded
Your request exceeded the time limit for processing. _

Going through debug logs shows that NO exception is being thrown (despite the Try wrapper around the call). Instead the getContentAsPdf() call is returning after just over 2 minutes and processing is simply ending at that point.

Here are the relevant lines from the debug log:

 

<SNIP>
13:30:34.197 (197470000)|SYSTEM_METHOD_ENTRY|[21]|System.PageReference.getContentAsPDF() 13:32:36.249 (122249850000)|SYSTEM_METHOD_EXIT|[21]|System.PageReference.getContentAsPDF() 13:32:36.249 (122249973000)|CODE_UNIT_FINISHED|GroupOrderBackupAttach invoke(createSnapshot) 13:32:36.875 (122253275000)|CUMULATIVE_LIMIT_USAGE 13:32:36.875|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 1 out of 100 Number of query rows: 1 out of 50000 Number of SOSL queries: 0 out of 20 Number of DML statements: 1 out of 150 Number of DML rows: 1 out of 10000 Number of script statements: 11 out of 200000 Maximum heap size: 0 out of 3000000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 100 Number of record type describes: 0 out of 100 Number of child relationships describes: 0 out of 100 Number of picklist describes: 0 out of 100 Number of future calls: 0 out of 10 13:32:36.875 (122253275000)|CUMULATIVE_LIMIT_USAGE_END 13:32:36.253 (122253361000)|CODE_UNIT_FINISHED|VF: /apex/GroupOrderBackupAttach 13:32:36.253 (122253383000)|EXECUTION_FINISHED

Here's the relevant code:

 

public PageReference createSnapShot()
    {
        Snapshot__c ss= new Snapshot__c(Group_Order__c=go.Id,Snapshot_Date__c=Date.today(),Snapshot_Type__c='Audit');
        insert ss;
        
        PageReference pdf1 = Page.GroupOrderBackup;
        pdf1.getParameters().put('id',go.Id);

        Blob pdf1Blob;
        try{
        	pdf1Blob = pdf1.getContentAsPdf();
        }
        catch(Exception e){
        	pdf1Blob  = Blob.valueOf('Exception: ' + e.getTypeName() + ' - ' + e.getMessage() + ' - ' + e.getCause() + ' - ' + e.getLineNumber() + ' - ' + e.getStackTraceString());
        }
 
        Attachment a = new Attachment(parentId = ss.id, name='Full Backup_'+go.Name+'_'+datetime.now() + '.pdf', body = pdf1Blob);
        insert a;
       	
       	if (go.RecordType.Name == 'RTMS')
        {
        	PageReference excel = new PageReference('/apex/CustomExcelWithBackButton');
        	excel.setRedirect(true);
        	excel.getParameters().put('groupOrderId',go.Id);
    
        	return excel;
        } 
        else 
       	{
       		return controller.view();
       	}
    }

Any ideas on how to get past this? Is there a setting (either open or "Black") that can be changed to give us more time?

I am getting the following error (repeated for multi objects) during deployment from Sandbox to Sandbox (We are deploying using Ant).:

Error: workflows/Account.workflow(414,12):This workflow rule currently has pending actions in the workflow queue. To delete, please remove those pending actions.

The thing is that those pending actions were deleted a week ago, from both environments, the first time this came up. And I also deleted the workflows from my Eclipse project, deployed succesfully, and then re-added them to the project to make sure there was nothing in Eclipse that was the issue. Definitiely seems like the "Sending" Sandbox is "remembering" that there used to be pending actions.

Any suggestions on what I can do to clear this old information out?

I am getting errors like the above for property 'role', 'group', and 'roleAndSubordinates' for multiple objects in my org when I attempt to deploy from Sandbox to Sandbox. Friday evening deployment went off without a hitch and this afternoon, after making some class and page changes, I get these errors and am unable to get my code moved.

 

Wy do I think this has something to do with Summer '11 arriving in my Sandboxes yesterday? Any idea how to fix it?

I am running a series of queries to provide audit data to a client who wants on-demand snapshots of all the fields on a set of related objects. Everything runs fine except that for one object I receive 'System.UnexpectedException: Query is either selecting too many fields or the filter conditions are too complicated.'

 

The queries are all identical in structure and very simple (ie SELECT field 1, field2, ... fieldn FROM object WHERE Related_Object_Id = Id.) What is really odd is that the object we have this error with is NOT the largest object we are reporting on (by about 20%). SInce these queries are built dynamically using Schema.SObjectType.<object_Name>.fields.getMap(), trimming out columns would be messy, not to mention contrary to the clients needs.

 

Any ideas of why this could be happening? And what I can do to fix it? Is there a documented limit on the number of columns allowed in a query?

 

 

I would like to use the Fuel Gauge dashboard component in a VF page that will placed into a layout, Can I do this? The gauge would be driven by a controller that calculates how many fields on the page have been filled out and would display at the top of this page. The page itself would be stock except for the addition of the VF page containing the gauge.

 

I can do something like this using the Google Chart API but their gauge just does not look right.

 

Any ideas?

We have Javascript Remoting in use in our Production instance (Summer '11) and it works like a charm. Our Sandbox was just "upgraded" to Winter 12 and now we are getting reference errors on code that has not changed in 2 months. What gives?

Our client needs us to dump records from several large related objects into PDFs for archival use. These PDF's are then saved as record attachments in a custom object named Snapshot. The PDF's generate with no problem as long as the nuumber of records involved is below a certain number. Beyond that point we get the following error on screen:

Time limit exceeded
Your request exceeded the time limit for processing. _

Going through debug logs shows that NO exception is being thrown (despite the Try wrapper around the call). Instead the getContentAsPdf() call is returning after just over 2 minutes and processing is simply ending at that point.

Here are the relevant lines from the debug log:

 

<SNIP>
13:30:34.197 (197470000)|SYSTEM_METHOD_ENTRY|[21]|System.PageReference.getContentAsPDF() 13:32:36.249 (122249850000)|SYSTEM_METHOD_EXIT|[21]|System.PageReference.getContentAsPDF() 13:32:36.249 (122249973000)|CODE_UNIT_FINISHED|GroupOrderBackupAttach invoke(createSnapshot) 13:32:36.875 (122253275000)|CUMULATIVE_LIMIT_USAGE 13:32:36.875|LIMIT_USAGE_FOR_NS|(default)| Number of SOQL queries: 1 out of 100 Number of query rows: 1 out of 50000 Number of SOSL queries: 0 out of 20 Number of DML statements: 1 out of 150 Number of DML rows: 1 out of 10000 Number of script statements: 11 out of 200000 Maximum heap size: 0 out of 3000000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 100 Number of record type describes: 0 out of 100 Number of child relationships describes: 0 out of 100 Number of picklist describes: 0 out of 100 Number of future calls: 0 out of 10 13:32:36.875 (122253275000)|CUMULATIVE_LIMIT_USAGE_END 13:32:36.253 (122253361000)|CODE_UNIT_FINISHED|VF: /apex/GroupOrderBackupAttach 13:32:36.253 (122253383000)|EXECUTION_FINISHED

Here's the relevant code:

 

public PageReference createSnapShot()
    {
        Snapshot__c ss= new Snapshot__c(Group_Order__c=go.Id,Snapshot_Date__c=Date.today(),Snapshot_Type__c='Audit');
        insert ss;
        
        PageReference pdf1 = Page.GroupOrderBackup;
        pdf1.getParameters().put('id',go.Id);

        Blob pdf1Blob;
        try{
        	pdf1Blob = pdf1.getContentAsPdf();
        }
        catch(Exception e){
        	pdf1Blob  = Blob.valueOf('Exception: ' + e.getTypeName() + ' - ' + e.getMessage() + ' - ' + e.getCause() + ' - ' + e.getLineNumber() + ' - ' + e.getStackTraceString());
        }
 
        Attachment a = new Attachment(parentId = ss.id, name='Full Backup_'+go.Name+'_'+datetime.now() + '.pdf', body = pdf1Blob);
        insert a;
       	
       	if (go.RecordType.Name == 'RTMS')
        {
        	PageReference excel = new PageReference('/apex/CustomExcelWithBackButton');
        	excel.setRedirect(true);
        	excel.getParameters().put('groupOrderId',go.Id);
    
        	return excel;
        } 
        else 
       	{
       		return controller.view();
       	}
    }

Any ideas on how to get past this? Is there a setting (either open or "Black") that can be changed to give us more time?

I am getting the following error (repeated for multi objects) during deployment from Sandbox to Sandbox (We are deploying using Ant).:

Error: workflows/Account.workflow(414,12):This workflow rule currently has pending actions in the workflow queue. To delete, please remove those pending actions.

The thing is that those pending actions were deleted a week ago, from both environments, the first time this came up. And I also deleted the workflows from my Eclipse project, deployed succesfully, and then re-added them to the project to make sure there was nothing in Eclipse that was the issue. Definitiely seems like the "Sending" Sandbox is "remembering" that there used to be pending actions.

Any suggestions on what I can do to clear this old information out?

I am running into a very serious error with deploys, and before I log a case, was wondering if anyone else has seen this.

 

I have two sandboxes, A and B.  A is in Spring 11 and B is in Summer 11.

 

In my org, I have a VF Page and its controller which utilizes javascript remoting.  It works fine in both Sandbox A and B.

 

Now lets say I make a change to an sobject, such as adding a field that is not referenced anywhere, then deploy just this changed sobject to sandbox B.

 

After the deploy, the VF Page and its controller break in Sandbox B, but continue to work in Sandbox A.  The error given is a strange one:

 

Visualforce Remoting Exception: Cannot call test methods in non-test context

 

I am definitely not calling test methods from my remote apex.  If I drill into the error with Firebug, I can see it gets thrown in the following code (which is salesforces):

 

 

Visualforce.remoting.Util = {
log: function(msg, obj) {
if (typeof console === 'undefined' || !console.groupCollapsed || !console.log || !console.groupEnd) return;
if (typeof obj !== 'undefined' && obj !== null) {
try {
console.groupCollapsed(msg);
console.log(obj);
console.groupEnd();
} catch(e) {}
} else {
try { console.log(msg); } catch(e) {}
}
}, 

 

 

I can then add one dummy line (it literally does not matter what I add) of code to the problematic VF page and its controller, then I can redeploy the page and its controller, and things work again in Sandbox B.

 

This is quite strange, but I can consistently reproduce it with these steps.

 

Any ideas?