We changed our privacy policy. Read more.

New answers tagged

3

You can use the following Date Functions: CALENDAR_MONTH CALENDAR_YEAR DAY_IN_MONTH Which in combination would look like: WHERE CALENDAR_YEAR(Date__c) = 2021 AND CALENDAR_MONTH(Date__c) = 7 AND DAY_IN_MONTH(Date__c) = 31 If you want it to be always a specific date last year, you need a Date Literal as well. That would change your query filter to: WHERE ...


3

you can use SOQL Date Literals: with a combination of date functions. For your current example: WHERE Date__c = LAST_YEAR AND CALENDAR_MONTH(Date__c) >= 8


1

When doing joins that pull in parent fields, you need to use the Relationship Name of the field, not its API Name. In this case, OwnerId should instead be Owner, and WhatId should instead be What. Unfortunately, joins typically do not work on polymorphic fields, and I am fairly sure What.Name will still fail. It is, however, the only correct field path.


0

Your code would be like this with the added condition public static List<EventObj> getEvents(String sObjectName, String titleField, String startDateTimeField, String endDateTimeField, String descriptionField, String userField, Boolean filterByUserField){ String q = 'SELECT Id,' + String.valueOf(titleField) + ',' + String.valueOf(...


0

Your queries are complex and not ideal as pointed out but are not the curl-pit. System Data Views are built-in backend Data Extensions that can be queried directly. Because they are holding real-time data, you will find that read requests from your SQL can become deadlocked for write requests from other processes such as sent. I would not recommend to query ...


0

You need to run this in anonymous console. System.debug([select id, LastModifiedBy.name from lead where IsDeleted=TRUE ALL ROWS ]);```


Top 50 recent answers are included