• ALimas22
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies

I need to get the milliseconds of the "CreatedDate" field for a case in my Apex controller extension class.  The code looks like this:

 

long creationDateInMillis = ((DateTime)aCase.get('CreatedDate')); // aCase is the object that's passed in to the constructor

 

When the method that contains this line gets invoked, that line causes the error "System.TypeException: Invalid conversion from runtime type Date to Datetime".

 

According to the documentation, "CreatedDate" is of type  "DateTime", so I'm confused as to why the above casting would not work and why it thinks "CreatedDate" is a "Date" instead of a "DateTime"?

 

I'd like to know what I'm doing wrong here.  I need the accuracy down to the milliseconds, so cannot just cast to "Date" as that'll loose the time component.

 

Thank you.

For administrative purposes, I need to get a list of active session IDs for users logged in to my SFDC organization and from which I can potentially also get the session objects and manipulate them, e.g. kill the sessions as needed.  Is there such an API in SFDC to achieve that?

Hello,

 

I tried to use variables (merge fields) in  a custom label (used inside a VisualForce page) like this

 

<a href="something">View</a> case {!Case.CaseNumber} submitted on {!Case.CreatedDate}.

 

That doesn't work for and I'd like to find out if that custom label content/text needs to be formatted differently or if it's just not supported.

 

I tried to search around but didn't find any example/documentation about this.

 

Thank you.

 

al

I need to get the milliseconds of the "CreatedDate" field for a case in my Apex controller extension class.  The code looks like this:

 

long creationDateInMillis = ((DateTime)aCase.get('CreatedDate')); // aCase is the object that's passed in to the constructor

 

When the method that contains this line gets invoked, that line causes the error "System.TypeException: Invalid conversion from runtime type Date to Datetime".

 

According to the documentation, "CreatedDate" is of type  "DateTime", so I'm confused as to why the above casting would not work and why it thinks "CreatedDate" is a "Date" instead of a "DateTime"?

 

I'd like to know what I'm doing wrong here.  I need the accuracy down to the milliseconds, so cannot just cast to "Date" as that'll loose the time component.

 

Thank you.

Hello,

 

I tried to use variables (merge fields) in  a custom label (used inside a VisualForce page) like this

 

<a href="something">View</a> case {!Case.CaseNumber} submitted on {!Case.CreatedDate}.

 

That doesn't work for and I'd like to find out if that custom label content/text needs to be formatted differently or if it's just not supported.

 

I tried to search around but didn't find any example/documentation about this.

 

Thank you.

 

al