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

Cannot convert type 'sforce.sObject' to 'sforce.Quote'

Writing a program and I get this error on my server, but not my local machine. Any ideas on why its different?


Here is the line of code in question:


opp = (Quote)qr.records[i];




Maybe what is happening is the query is not returning any quotes, be sure the query return some quotes. Other thing is that the query you use to obtain that list of quotes is not getting all the field related to quotes and then the content of SObject didn't match with the content of a Quote object.

Chack that, or give me more information about the query you use to get that list of quotes or how are you getting the content for qr.records.