function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nickfs92840nickfs92840 

Visualforce Error Message

Hello,

 

I have created a visual force page with a print button. When I press the print button, I receive this error below. Any ideas on what I'm doing wrong?

 

Please let me know.

 

Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
Damien_Damien_

I'm wondering if my print button is on the incorrect object? It's currently on the Contract_Language_Amendment_Tracking__c and should it be on the Highlight_Sheet__c object?

Maybe, but if that is true, you need to be passing the correct id into your page.  You are passing the Id of the Contract_Language_Amendment_Tracking__c into your page right now.  That is the reason I had you switch your standardController.

All Answers

Damien_Damien_

The id you are passing into your visualforce page, is not of an object of type HIghlight_Sheet__c.  You need to be using whatever object the page would take you to.

 

https://yoursalesforceinstance.salesforce.com/a0b80000001kTzU

NikhilNikhil

Think you are using a controller estenssion and you are passing the wrong idd probably not of the object you are using in the controller.

nickfs92840nickfs92840

Below are some screenshots I've taken of where the id may be at.

 

 

 

 

 

The custom button is on the Contract_Language_Amendment_Tracking__c custom object and here is the code for it:

 

 

 

 

 

Damien_Damien_

Ok so it looks like you should have

 

standardController="Contract_Language_Amendment_Tracking__c"

nickfs92840nickfs92840

I tried that but I get this error:

 

Damien_Damien_

You are probably referencing the Highlight_Sheet__c somewhere, and it doesn't exist on this page.

 

If you need a Highlight_Sheet__c, you need to be passing the ID of a Highlight_Sheet__c into the page.  From what you showed us, you are passing an id of that other object into it.  Basically, you need to keep your references consistent, and figure out what object you really need and make all the references to that object.

nickfs92840nickfs92840

So what I've done is created two custom objects:

Contract_Language_Amendment_Tracking__c

&

Network_Update__c

The main record holder is on the Account Page.

The heirarchy looks like this:

Account
     L   Contract Language Amendment Tracking
                 L    Network Update

The custom print button is on the Contract Language Amendment Tracking object.

The print button is pulling information from the Account, Contract Language Amendment Tracking and Network Update objects.

I'm wondering if my print button is on the incorrect object? It's currently on the Contract_Language_Amendment_Tracking__c and should it be on the Highlight_Sheet__c object?

Damien_Damien_

I'm wondering if my print button is on the incorrect object? It's currently on the Contract_Language_Amendment_Tracking__c and should it be on the Highlight_Sheet__c object?

Maybe, but if that is true, you need to be passing the correct id into your page.  You are passing the Id of the Contract_Language_Amendment_Tracking__c into your page right now.  That is the reason I had you switch your standardController.

This was selected as the best answer
nickfs92840nickfs92840

Ok gents, figured it out. I needed to place the custom print function button on the Highlight_Sheet__c object. The standardcontroller was changed to Contract_Language_Amendment_Tracking__c.

 

Thank you guys!