• jsorribas
  • NEWBIE
  • 25 Points
  • Member since 2011

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

Hi all,

I have this code into a class in which I have to program to execute daily in SalesForce.

 

list<User> registrosUser = [select id, title, firstname, lastname, email, phone, ContactId
                                FROM User WHERE ContactId <>: null AND LastLoginDate = YESTERDAY];
            
        for(User rUser : registrosUser){
            
            Contact ctc = [select id, Inicio_Sesion__c, Ultimo_inicio_de_sesion__c FROM Contact WHERE id=: rUser.ContactId LIMIT 1];
            System.debug(ctc.Ultimo_inicio_de_sesion__c);
            ctc.Ultimo_inicio_de_sesion__c = rUser.LastLoginDate;
            ctc.Inicio_Sesion__c = true;
            update ctc;
        }

 

I have tried this code within the developer shell, and the query returns the correct register, but this line appears on the debug output:

 

13:06:13.033 (33547000)|EXCEPTION_THROWN|[8]|System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: User.LastLoginDate
13:06:13.033 (33585000)|HEAP_ALLOCATE|[8]|Bytes:95
13:06:13.033 (33725000)|FATAL_ERROR|System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: User.LastLoginDate

 

Could you help me about this exception??

 

Thanks in advance!

Hi,

I'd like to create a formula field in a new object dubbed AAA, whose new formula field is dubbed "Last_session_login" and I want this field to reference a field of Contact object dubbed Session__c.

I have tried typing {!Contact.Session__c}, but an error appears indicating that this field does not exist.

 

How do I manage to reference any field that does not appear into the dropbox ??

 

Thanks in advance

Hi all,

 

I am trying to recover some Contacts form a Visualforce page through an Apex class.

 

Since I click on the Contacts tab, I get to a view list where some contact are selected by their checkbox. A new button has been added to the View List to take these contacts to another page. When I get this page, the contacts are shown in a pageBlockTable. How do I get to recover these contacts from the extension Apex page?

 

Thanks in advance

Has anyone successfully added in the sforce toolkit and sfdc excel connector within excel 2010?

Hi,

I'd like to create a formula field in a new object dubbed AAA, whose new formula field is dubbed "Last_session_login" and I want this field to reference a field of Contact object dubbed Session__c.

I have tried typing {!Contact.Session__c}, but an error appears indicating that this field does not exist.

 

How do I manage to reference any field that does not appear into the dropbox ??

 

Thanks in advance

Hi all,

 

I am trying to recover some Contacts form a Visualforce page through an Apex class.

 

Since I click on the Contacts tab, I get to a view list where some contact are selected by their checkbox. A new button has been added to the View List to take these contacts to another page. When I get this page, the contacts are shown in a pageBlockTable. How do I get to recover these contacts from the extension Apex page?

 

Thanks in advance