• SFDC Beginer
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 10
    Replies
I have implemented the start method but still am getting above error.
below is my code. could anyone explain me.
global class Sample_Contactupdate_Batch implements Database.batchable<Contact> {
    
    global database.QueryLocator start(Database.BatchableContext jobid)
    {
        String query='select id,name,DOB__c from Contact where createdDate<=180' ;
          return  database.getQueryLocator(query);
        // we can query upto 50 million records
    }
    global void execute(Database.BatchableContext jobid,list<Contact> scope)
    {
        List<Contact> ctc=new List<Contact>();
        //Contact c=new Contact();
        for(Contact c:scope)
        {
            c.DOB__c=system.today+200;
           ctc.add(c);
        }
        update ctc;
    }
    global void finish(database.BatchableContext jobid)
    {
        
    }

}
Hi all,
I need some information from you guys. I have basic idea on Admin part.
I want to clear the Admin certification with in 2 months. Could you any please suggest me how can I achive ?
 I wrote below  code in Debuglog window:
ScheduledApex_2 sa=new ScheduledApex_2();
String s='0 22 6 ? * *';
String myjob=System.schedule('Fifth', s, sa);
CronTrigger ct=[SELECT Status,TimesTriggered,NextFireTime From CronTrigger Where Id=:myjob];
when I want to know the  when it triggered and status for the first time it shceduled then only we are able to check by using above.
When I want to know the status once it is started and completed and number of times triggered, am unable do that.
for example: I shceduled and it ran for 2 times,
so when I am using above logic it is saying it is already shceduled.I am not getting any result.
I just want to know like status of myjob,  2 times triggered, and next schedule date is so and so etc 
could anyone please help me in this?
 
I am unable to see any debuglogs for the apex calses and triggers  that I ran. could any please suggest me what has to be done.
I set the dates also. and I am the Admin...
Hi everyone,
I created one custom filed accountcount and when ever new account created, count is reflected in that filed.
now requirement is like " need to display the message when the record is created and need to display the message like this the 48th record".
below is the code for account count, and i want to display the message.could anyone please sugggest me how to achieve this?

public class CountAccount {
    public static void accountscount(List<Account> accs)
    {
     Decimal CountOfAccount=[Select COUNT() From     Account];
    for(Account a:accs)
    {
       a.AccountCount__c=CountOfAccount+1;
       CountOfAccount=a.AccountCount__c;
    }
       
    }

}
 
Hi am facing below Error.
Logic needs to be implemented :If type is Contract Flow and Document Attached is True then HandOffAttached =True, otherwise False
I have one Designation  custom Object
created 3 fileds Type(picklist), document attached(checkbox) ,  Handoffattached(picklist)..
I have written below code:

trigger DesignationTrigger on Designation__c (after insert, before update) {
    // If type is Contract Flow and Document Attached is True then HandOffAttached =True, otherwise False
 
    for(Designation__c dc:Trigger.new)
    {
        if(dc.type__c=='ContractFlow' && dc.DocumentAttached__c==True)
        {
           dc.HandOffAttached__c='True';
        }
      else
          dc.HandOffAttached__c='True';
    }
  
}

I am getting the below error.  I am not sure whether i follwed correct approch or not for the gven logic .could any pleasae please guide me on this ? I really need your help in these triggers.
Apex trigger DesignationTrigger caused an unexpected exception, contact your administrator: DesignationTrigger: data changed by trigger for field HandoffAttached: bad value for restricted picklist field: True
Hi everyone,
this is the logic need to be work on.
I have one custom object Designation.
If type filed is Contract Flow and DocumentAttached  filed is True then HandOff Attached =True, otherwise False
How to implement the code for this.
i took the events as after insert, after update.
Hi everyone, this is the task :  
// Populate contact description with modified user name when user updates contact.
trigger Contact_Before_Update on Contact (before update)
{     for(   Contact c:Trigger.new)  
       {    c.Description='Contact update is successed by'+userInfo.getUserName();  
} }
// actully in for loop when I use Trigger.old, am getting run time erro. we can use Trigger.old right becaz before update we alaredy had the existing record right?  Could anyone please explain me..am so confused. when I write Trigger.new its working fine. why cant we use Trigger.old here?
can we get the contact details in Account page layout?
I am unable to see any debuglogs for the apex calses and triggers  that I ran. could any please suggest me what has to be done.
I set the dates also. and I am the Admin...
Hi everyone,
I created one custom filed accountcount and when ever new account created, count is reflected in that filed.
now requirement is like " need to display the message when the record is created and need to display the message like this the 48th record".
below is the code for account count, and i want to display the message.could anyone please sugggest me how to achieve this?

public class CountAccount {
    public static void accountscount(List<Account> accs)
    {
     Decimal CountOfAccount=[Select COUNT() From     Account];
    for(Account a:accs)
    {
       a.AccountCount__c=CountOfAccount+1;
       CountOfAccount=a.AccountCount__c;
    }
       
    }

}
 
Hi am facing below Error.
Logic needs to be implemented :If type is Contract Flow and Document Attached is True then HandOffAttached =True, otherwise False
I have one Designation  custom Object
created 3 fileds Type(picklist), document attached(checkbox) ,  Handoffattached(picklist)..
I have written below code:

trigger DesignationTrigger on Designation__c (after insert, before update) {
    // If type is Contract Flow and Document Attached is True then HandOffAttached =True, otherwise False
 
    for(Designation__c dc:Trigger.new)
    {
        if(dc.type__c=='ContractFlow' && dc.DocumentAttached__c==True)
        {
           dc.HandOffAttached__c='True';
        }
      else
          dc.HandOffAttached__c='True';
    }
  
}

I am getting the below error.  I am not sure whether i follwed correct approch or not for the gven logic .could any pleasae please guide me on this ? I really need your help in these triggers.
Apex trigger DesignationTrigger caused an unexpected exception, contact your administrator: DesignationTrigger: data changed by trigger for field HandoffAttached: bad value for restricted picklist field: True
can we get the contact details in Account page layout?
Hi Guys,

It is quite a while I do not touch Salesforce so this may be easier than I think. I have a custom object, change request box. I need a field that shows the line manager of the requestor. I thought I could do a formula field as the User object already have a Manager field, so I would just pick that up. However, the only option I see is a ManagerID. There is any way I can get the Manager name instead? When I do the formula field, should not just display an option for it and automatically pick up the line manager from the lookup(user) field I have in the object (requestor)? Thank you :)