• Manoj Gautam 1
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
I am working on a very simple usecase that can be easily coded in a trigger but I want to use Process builder for it.

Use case: When an opportunity stage ="WON", create a contract record. I am stuck at setting the values for the contract record. Please take a look at the screen for error. How can I set the AccountId field on the Contract record?
User-added image
Hi

I updated contact name everyday means only those records modified same day that records only updated i wrote the batch apex but it's not work properly.


global class batchContactUpdate implements Database.Batchable<sObject> {
        
        
    global Database.QueryLocator start(Database.BatchableContext BC) {
        Date d=date.today();
        System.debug('d');
        String query = 'SELECT Id,LastName,Phone FROM Contact where LastModifiedBy - d';
        return Database.getQueryLocator(query);
    }
   
    global void execute(Database.BatchableContext BC, List<Contact> scope) {
         for(Contact con : scope)
         {
             con.LastName = con.LastName + 'Updated';            
         }
         update scope;
    }   
    
    global void finish(Database.BatchableContext BC) {
    }
}


Regards,
MPL

i am updating few records[5 records in a for loop], and ALL the records are saved with lastmodified date as 2011-11-02T15:43:56.000Z

 and later i need to print them querying the table in the order of ascending order of lastmodifieddate field.

But it does not print so... as.i need to sort on lastmodifieddate field, i need the timestamp based on milliseconds. How do i set milliseconds in the lastmodifieddate field

 

i explicitly  update each of these records inside a for loop, but it does not have fraction of second captured.

 

for(String seqnsdInput : sequencedInput ){

    doctrckr = mapInputSeqnDocTracks.get(seqnsdInput);

    update doctrckr;

}

Here the lastmodified date is same for all doctrckr object

Kind regards...