I want you to act as a salesforce apex language interpreter. Write an apex trigger to process contacts before update and check if the field Email is being updated. If yes then update a field on that contact record Email_Updated_Date__c to the current date time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Map<Date, List<Task>> tasksbyweek = new Map<Date, List<Task>>(); | |
for(Task t : tasks) { | |
Date weekstart = new Date(); | |
if(tasksbyweek.get(weekstart)==null) | |
tasksbyweek.put(weekstart, new List<Task>()); | |
tasksbyweek.get(weekstart).add(t); | |
} | |
Map<Id, LIST<Case>> caseMap = new Map<Id, LIST<Case>>(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestResource(urlMapping='/xxxx/*') | |
global with sharing class MyWLResource { | |
@HttpPost | |
global static void doPost(String accountid) | |
{ | |
Account myaccount; | |
list <Opportunity> myresult; | |
try | |
{ | |
myaccount = [select website from Account where id=:accountid]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<svg width="75" height="50" viewBox="0 0 256 180" version="1.1" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMid"> | |
<g> | |
<path d="M106.553203,159.610976 C114.801129,168.204994 126.284107,173.534815 138.983873,173.534815 C155.865892,173.534815 170.594851,164.121105 178.438396,150.146262 C185.254593,153.191874 192.799405,154.885905 200.737669,154.885905 C231.186506,154.885905 255.871995,129.985475 255.871995,99.2706935 C255.871995,68.5522694 231.186506,43.651839 200.737669,43.651839 C197.021731,43.651839 193.389583,44.0234329 189.877657,44.7338328 C182.970383,32.4129469 169.807947,24.0885163 154.700107,24.0885163 C148.375726,24.0885163 142.393793,25.5493901 137.067615,28.1469039 C130.065621,11.6765534 113.751923,0.127999726 94.7387049,0.127999726 C74.9385822,0.127999726 58.0638501,12.6565411 51.5864595,30.2271008 C48.7557888,29.6259931 45.8231119,29.3126885 42.8139304,29.3126885 C19.23958,29.3126885 0.127998772,48.6209959 0.127998772,72.4430755 C0.127998772,88.40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!groovy | |
pipeline { | |
agent any | |
options { | |
timeout(time: 5, unit: 'MINUTES') // timeout all agents on pipeline if not complete in 5 minutes or less. | |
} | |
parameters { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// API we will consume | |
// https://developer.zendesk.com/rest_api/docs/support/users | |
// Create a named credential "Zendesk" with the following value "https://company.zendesk.com/api/v2" | |
// Substitute in your company and the correct version number | |
public class ZendeskService { | |
// create static variable for the endpoint we are going to leverage | |
private static String CUSTOMER_RESOURCE = '/users/create_or_update.json'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@isTest | |
private class ProcessContacts_Test { | |
@testSetup static void setup() { | |
// Create contact record | |
List<Contact> testContacts = new List<Contact>(); | |
for(Integer i=0;i<1;i++) { | |
testContacts.add(new Contact(FirstName = 'GoogleBard'+i, | |
LastName = 'Test')); | |
} | |
insert testContacts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {number[]} nums | |
* @param {number} target | |
* @return {number[]} | |
*/ | |
var twoSum = function(nums, target) { | |
let numObj = {} | |
for(i = 0; i < nums.length; i++) { | |
let other = target - nums[i]; | |
if(numObj[other] !== undefined) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.last = function() { | |
if(!this?.length) return -1; | |
return this.pop(); | |
}; | |
/** | |
* const arr = [1, 2, 3]; | |
* arr.last(); // 3 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {number} x | |
* @return {boolean} | |
*/ | |
var isPalindrome = function(x) { | |
if(x < 0) return false; | |
if(x == 0) return true; | |
if(x.toFixed(0).split('').reverse().join('')-0 == x) return true; | |
return false; | |
}; |
OlderNewer