Skip to content

Instantly share code, notes, and snippets.

// get active benefits for Contact, order by expiration date ascending
List<Benefit__c> beneList = [SELECT Id, BenefitLevel__c FROM Benefit__c WHERE Contact__c = :contactId ORDER BY ExpirationDate__c ASC];
// Get set of BenefitLevels referenced by the above
Map<Id, Benefit__c> beneMap = new Map<Id, Benefit__c>(beneList);
// get usage discount codes associated with these benefit levels
List<DiscountCodeBenefitLevelLink__c> memberDiscounts = [SELECT DiscountCode__r.Id, DiscountCode__r.MemberUsageLimit__c...
FROM DCBLL__c WHERE BenefitLevel__c IN :beneLevelSet];
@tfuda
tfuda / event
Last active June 27, 2018 17:19
Layout HOC
class Event extends Component<EventProps & RouteProps> {
public componentDidMount() {
const {selectedEvent, eventList, fetchEvent, setSelectedEvent, match} = this.props;
const teId = match.params.teId;
if (selectedEvent && selectedEvent.id === teId) {
// The selected event has already been fetched
return;
}
let event;
if (eventList) {
private static void sendUsernameChangeEmails(Set<Id> userIdSet) {
if (userIdSet.isEmpty()) return;
EmailTemplate template = OrderProcessingUtils.getEmailTemplate('Patron_Ticket_Patron_Portal_New_Username');
PatronTicketSettings__c settings = TicketUtil.getSettings();
OrgWideEmailAddress owea = null;
String senderDisplayName = null;
EditCatchStateType = {
// Pretty much the same as what you have for EditCatchContextType now
}
export EditCatch = ({navigation, route} : EditCatchProps) => {
const [editCatchState, setEditCatchState] = useState<EditCatchStateType>(/* initial state value */);
const handleLengthChange = useCallback((length: number) => {