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
SrinuSrinu 

List has more than 1 row for assignment to SObject

Hi All,

 

   Is there anyway to see full debug?

 

 Actually I am getting one error, while executing my opportunity wizard, but I could not see that error in my debug log. 

 What I am suspecting is: Showing Debug is not in full length.....becoz it might be in full of Size, So it shows half debug only.

 

Is there any way see full debug?  If I can see full debug, I may see In which line error occurs.

 

 

Any help would be greatly appreciated...!!

 

-Srinu

ChopaForceChopaForce

Hello Srinu,

 

When you are talking about the debug log, are you referring to the one that you can activate  by going to : Setup -> Monitoring -> Debug Log ? If so, perhaps there's more than one log generated by your wizard...

 

If it's possible, you should search for all the assignments done by a soql query in your class and add a debug statement:

i.e :

//instead of this:
Opportunity myOpp = [select id from Opportunity];

//try this
List<Opportunity> lstOpp = [select id from Opportunity];
Opportunity myOpp;
if (lstOpp.size() > 0)
{
System.debug('***** lstOpp returned more than 1 record at line X.');
//handle any error it may cause
}
else
myOpp = lstOpp[0];

 

There should be a place in your code where you are not expecting a list but simply one record..

 

Hope it helps,

 

Chopa

 

gottipolugottipolu

Hi Chopa,

 

I'm srinu's colleague. Yes...it is  Setup -> Monitoring -> Debug Log. Our wizard is generating only one debug log. strangely the error is not found anywhere in it. We thought may be the debug log size has been exceeded. Is that possible?

ChopaForceChopaForce

Hello gottipolu,

 

Yes it is possible. According to the documentation, a debug log can only be 2MB. Debug logs that are larger than 2 MB in size are truncated.

 

link: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_debugging_debug_log.htm