1

I am trying to upload a csv file and creating object(code) using the contents of file.I have created a custom link on detail page of my custom object(line) like this(on click javascript) - window.top.location.href='/apex/Zip_Codes?Id={!Line__c.Id}'

I have also created class and a vf page to load the csv file. In vf page m using standard controller as Document and extension as my controller class.

But on clicking the custom link currently i am getting the below error-

Id value a0Sn00000005v0k is not valid for the Document standard controller

As per my observation this error is coming as it is passing 15 digit id to Document object and it is expecting a 18 digit id. What is the solution for this. Please help.thanks in advance.

4
  • I think this is a syntax issue. Because of the standard controller the passed ID should be of type Document. In your case it is of type Line__c. Try to rename the ID parameter to something else, for example lineId. Commented Feb 23, 2015 at 10:10
  • i want to pass id of my line object to Document. Document is predefined standard controller for salesforce which i m using to process the document(csv file) uploaded by user.
    – user12051
    Commented Feb 23, 2015 at 10:12
  • Read this article: Building Visualforce Pages Using Standard Controllers. Especially the following: The standard controller requires record context that can be provided by including a URL parameter named ‘id’ and assigned with a valid 15- or 18-digit record ID. The record specified by the ID must match the sObject type associated with the StandardController on the page, or an error will be thrown when the page attempts to render So you need to pass an Document ID instead of the Line__c ID. Commented Feb 23, 2015 at 10:17
  • In other words if using standard controller the ID parameter is reserved. You have to pass your custom values using other parameter names. Commented Feb 23, 2015 at 10:19

1 Answer 1

1

I think this is a syntax issue. Because of the standard controller the passed ID should be of type Document. In your case it is of type Line__c. Try to rename the ID parameter to something else, for example lineId.

Read this article: Building Visualforce Pages Using Standard Controllers. Especially the following:

The standard controller requires record context that can be provided by including a URL parameter named ‘id’ and assigned with a valid 15- or 18-digit record ID. The record specified by the ID must match the sObject type associated with the StandardController on the page, or an error will be thrown when the page attempts to render.

So you need to pass an Document ID instead of the Line__c ID

In other words if using standard controller the ID parameter is reserved. You have to pass your custom values using other parameter names.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .