• alexf99
  • NEWBIE
  • 55 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hello All,

 

Like in java if we want to see the variable value while debuging  the code or after running the application

 

we put System.out.println('') statement to monitor the value on console.

 

In Apex how to monitor this value using System.debug since we dont have console here..

 

Can anybody tell me the way with simple example i.e Class with the only System.debug statement.

 

 

Thanks,

Sandip

 

Hi,

 

I'm fairly new to Apex, so hopefully I've just missed something. It seems to me that there is no common superclass of all Apex classes. We have Object, which is the superclass of all sObjects. But nothing for Apex classes themselves.

 

As a result it's impossible for example to have any generic methods for working with Lists of Apex objects, only sObjects.

 

E.g. what would work instead of the ??? below:

 

public class ListUtil {
  
  public static Boolean contains(List<???> theList, ??? element) {

 

for (??? obj : theList) if (obj == element) return true;

return false; 

 

  }
 

}

 

So you might want to be able to...

 

List<ApexPages.Message> messages = ... 

ApexPages.Message aMessage =  ...

ListUtil.contains(messages, aMessage);

 

 or

 

List<MyApexClass> aList = ... 

MyApexClass element =  ...

ListUtil.contains(aList, element);

 

Not possible? This would be useful, particularly for unit tests!

 

Alex 

Hello All,

 

Like in java if we want to see the variable value while debuging  the code or after running the application

 

we put System.out.println('') statement to monitor the value on console.

 

In Apex how to monitor this value using System.debug since we dont have console here..

 

Can anybody tell me the way with simple example i.e Class with the only System.debug statement.

 

 

Thanks,

Sandip