• Ketan Mahet
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 4
    Replies
Hi,
  For Case screen we have two related list ("Emails", "Activity History") from where we can send email. I want to auto populate Case Subject line as email subject. How to achieve this? Even I tried "Predefined Field Value for Send Email" but it is also not auto populating the value.

 
I want to schedule a job runs every 5 mins. I have written the following code it is working fine but as the minutes reaches to 0, it is not creating any new job. so for the hour the job start it works fine till that hour finishes. I want to keep it running through out the day month and year.

Apex Class:
global class scheduledTest implements Schedulable{
    global void execute(SchedulableContext SC) {
        
        
        testMethod();
        
        DateTime dtNow = system.now();
        
        String day = string.valueOf(dtNow.day());
        String month = string.valueOf(dtNow.month());
        String hour =  string.valueOf(dtNow.hour());
        String minute = string.valueOf(system.now().minute() + 5);
        String second = string.valueOf(system.now().second());
        String year = string.valueOf(system.now().year());
        
        String strJobName = 'DistJob-' + second + '_' + minute + '_' + hour + '_' + day + '_' + month + '_' + year;
        String strSchedule = '0 ' + minute + ' ' + hour + ' ' + day + ' ' + month + ' ?' + ' ' + year;
        //String strSchedule = '0 ' + minute + ' * * * ?';
        System.schedule(strJobName, strSchedule, new scheduledTest());
    }
    
    private void testMethod(){
        system.debug('>>>>>' + system.now());
    }
}

From Dev console I am running the job only once as below:
scheduledTest jb = new scheduledTest();
jb.execute(null);
 
Hi,
   We have different watch list added to each Case. On sending manual email from any case, we want to add the watch list users to email CC. Is there any outbox of box functionality available in SFDC? As an alternative, I thought to capture the email context going outside of SFDC, add CC and send email.

Please guide.  
Hi All,
    I want to get picklist values of any object using SOQL ONLY. I know the other ways.

Please guide.

Regards
 
Hi All,
    We have enabled AMC and we want to show the currency field. We have the following scenario.
    The Opp is created with INR currency and logging user has USD as the currency. If we navigate to standard page we can see Opportunity field value as USD 2.00 (INR 120.00) 

We want to show the same format in our custom page as well. 
If we use the following but it is just showing $2.0

 <apex:outputText label="Amount(without conversion)"  value="{0, number, currency}"  >
       <apex:param value="{!Opportunity.Amount}"/>
  </apex:outputText>

Please guide.
 
Hi,
  Where retrieving data using SOQL, some of the field has value as null. Is there any way to return 0 or '' from the SOQL query result?

Regards,
Ketan Mehta
I want to schedule a job runs every 5 mins. I have written the following code it is working fine but as the minutes reaches to 0, it is not creating any new job. so for the hour the job start it works fine till that hour finishes. I want to keep it running through out the day month and year.

Apex Class:
global class scheduledTest implements Schedulable{
    global void execute(SchedulableContext SC) {
        
        
        testMethod();
        
        DateTime dtNow = system.now();
        
        String day = string.valueOf(dtNow.day());
        String month = string.valueOf(dtNow.month());
        String hour =  string.valueOf(dtNow.hour());
        String minute = string.valueOf(system.now().minute() + 5);
        String second = string.valueOf(system.now().second());
        String year = string.valueOf(system.now().year());
        
        String strJobName = 'DistJob-' + second + '_' + minute + '_' + hour + '_' + day + '_' + month + '_' + year;
        String strSchedule = '0 ' + minute + ' ' + hour + ' ' + day + ' ' + month + ' ?' + ' ' + year;
        //String strSchedule = '0 ' + minute + ' * * * ?';
        System.schedule(strJobName, strSchedule, new scheduledTest());
    }
    
    private void testMethod(){
        system.debug('>>>>>' + system.now());
    }
}

From Dev console I am running the job only once as below:
scheduledTest jb = new scheduledTest();
jb.execute(null);
 
Hi,
  Where retrieving data using SOQL, some of the field has value as null. Is there any way to return 0 or '' from the SOQL query result?

Regards,
Ketan Mehta