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='/Model2WebService/v1/*') | |
global with sharing class Model2WebService { | |
@HttpPost | |
global static void Model2ApiService() { | |
// Model2ApiService requires a Lead or Account ID to run | |
// endpoint: /services/apexrest/Model2WebService/v1?targetId=<Lead ID> | |
RestRequest request = RestContext.request; | |
String targetId = request.params.get('targetId'); | |
List<Id> targetIds = new List<Id>{}; |
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
Zip_Demographic__c[] leadQueryResnew = Database.query('SELECT Routing_Option__c FROM Zip_Demographic__c LIMIT 1'); | |
System.debug('Routing_Option__c: ' + leadQueryResnew[0].Routing_Option__c); | |
for(Zip_Demographic__c zip : leadQueryResnew) { | |
String routingOption = zip.Routing_Option__c; | |
System.debug('Routing_Option__c: ' + routingOption); | |
} |
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
List<String> notSendableResults = new List<String>{Constants.DoctorDeclined, Constants.NotCandidate, Constants.ReceivedElsewhere}; | |
Boolean isTestRecord = account.PersonEmail != null ? account.PersonEmail.contains('+ostest') : false; | |
if((account.PersonEmail != null || | |
Utilities.hasPhysicalAddress(account.BillingStreet, account.BillingCity, account.BillingState, account.BillingPostalCode)) && | |
(account.CreatedDate >= Datetime.now().AddYears(-3) || | |
scheduledAccountIds.contains(account.Id)) && | |
!isTestRecord && | |
!notSendableResults.contains(account.Consult_Result__c)) { | |
return true; |
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
private static Boolean sendable(Lead newLead, Set<Id> scheduledLeadIds) { | |
Boolean isTestRecord = newLead.Email != null ? newLead.Email.contains('+ostest') : false; | |
if((newLead.Email != null || | |
Utilities.hasPhysicalAddress(newLead.Street, newLead.City, newLead.State, newLead.PostalCode)) && | |
(newLead.CreatedDate >= Datetime.now().AddYears(-3) || | |
scheduledLeadIds.contains(newLead.Id)) && | |
!isTestRecord && | |
newLead.Inbound_Call__c != Constants.NonSalesCall && | |
newLead.Inbound_Call__c != null && |
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
FROM Consult_Inventory__c // from the Consult Inventory table | |
WHERE Scheduled_Time__c >= TODAY // where the Scheduled Time is greater than or equal to today | |
AND isConsultScheudled__c = 1 // and a Lead or Account is scheduled (it's not an empty block) | |
AND (Scheduled_Lead__r.Lead_Segment__c = NULL // Lead Segment is null for both Lead and Account | |
AND Scheduled_Account__r.Lead_Segment__c = NULL) | |
AND Scheduled_by__r.Name != 'Pat Greenwood' // remove to include Website | |
AND Scheduled_Lead__r.CreatedBy.Name != 'Website Api' // remove to include Website | |
AND Scheduled_Account__r.CreatedBy.Name != 'Website Api' // remove to include Website | |
ORDER BY Scheduled_Time__c // include if you want results ordered |
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
$ sfdx force:project:create --projectname sandbox --manifest | |
target dir = /Users/developer/workspace/clearchoice | |
create sandbox/sfdx-project.json | |
create sandbox/README.md | |
create sandbox/.forceignore | |
create sandbox/config/project-scratch-def.json | |
create sandbox/manifest/package.xml | |
$ ls | |
sandbox |
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
// Replace | |
SELECT id, Apt_Date__c,Arrival_Time__c, Consult_Room__c FROM Consult_Inventory__c WHERE Patient_Phone__c = '{global:SearchANI}' LIMIT 1 | |
// With | |
SELECT Id, Apt_Date__c, Arrival_Time__c, Consult_Room__c FROM Consult_Inventory__c | |
WHERE Consult_Room__r.Room_Type__c NOT IN ('Practice','Unconfirmed') | |
AND (Apt_Date__c >= LAST_N_DAYS:30 AND Apt_Date__c <= TODAY) | |
AND Special_Initiative__c NOT IN ('Workshop','Group Consult') | |
AND Pre_Screen_Type__c != 'Seminar' | |
AND isConsultScheudled__c = 1 |
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
DoseSpotAPI_v12_2017_01_05.GetMedicationListResponse response = apisoap.getMedicationList(signon, DoseSpot_ID, sources, statuses); | |
response_package.json_response = JSON.serializePretty(response); | |
response_package.is_ok = (response.Result.ResultCode == 'OK') ? true : false; | |
System.debug('Response : ' + response); | |
if (response.Result.ResultCode == 'OK') { | |
Integer medication_count; | |
// Looks like the test on the next line fails in production for 'Philadelphia Test1' which is unexpected. Need to confirm it's using the correct DoseSpot Patient ID and that the API is returning values in 'response' as expected. | |
try { |
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
public class ConnectToSalesforceRestApi { | |
public static void run(){ | |
String endpoint='https://login.salesforce.com/services/oauth2/token'; | |
// or use this endpoint for a sandbox org: | |
// String endpoint='https://test.salesforce.com/services/oauth2/token'; | |
String username = 'salesforce-usename@company.com'; | |
String password = 'salesforce-password'; | |
String CONSUMER_KEY = 'clientId'; | |
String CONSUMER_SECRET = 'clientSecret'; |
OlderNewer