• johnn dev
  • NEWBIE
  • 0 Points
  • Member since 2021

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

how to get data and month from a salesforce field

EXAMPLE: I need to get month and day from the "date" field, but the date field is filled with day/month/year example 05/15/2022. but I just want it to return the day and month from this field and I don't want it to return the year what is the formula for this apex class

imageis no longer used to variable inside the bot
how to put a map on the test calss
public with sharing class CookbookBot_GetOpenAppointments {

  @InvocableMethod(label='Get Open Appointments')
  public static List<List<Bot_Appointment__c>> getOpenAppointments(List<String> sEmails) {

    String sEmail = sEmails[0];

    // Get the list of new and scheduled appointments
    List<Bot_Appointment__c> appointments = [SELECT Id, Name, JobType__c, 
                                                    AppointmentDate__c, AppointmentSlot__c 
                                             FROM Bot_Appointment__c 
                                             WHERE Contact__r.Email =:sEmail 
                                             AND Status__c IN ('New','Scheduled')];

    // Create a list for the appointments
    // NOTE: This is a list of lists in order to handle bulk calls...
    List<List<Bot_Appointment__c>> appointmentList = new List<List<Bot_Appointment__c>>();

    // Add all the new and scheduled appointments to the list
    appointmentList.add(appointments);

    return appointmentList;
  }
}

help!!!!

how to get data and month from a salesforce field

EXAMPLE: I need to get month and day from the "date" field, but the date field is filled with day/month/year example 05/15/2022. but I just want it to return the day and month from this field and I don't want it to return the year what is the formula for this apex class