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 with sharing class MondoControllerExt { | |
private ID bookingId {get;set;} | |
private String pdfName {get;set;} | |
private Booking__c booking {get;set;} | |
private Booking__c bookingRef {get;set;} | |
private final ApexPages.StandardController controller; | |
public string pageMessage {get;set;} |
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 with sharing class AttendeeService { | |
/* | |
* Registers Attendees to a list of Sessions | |
* Params: | |
* Session Id lists mapped to Attendee id's | |
*/ | |
public static void registerAttendeeForSession(Map<Id, Id[]> sessionsByAttendee) { | |
// getting the data from the database |
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 MondoSample | |
{ | |
@future | |
public static void doCalc(List<Id> opps) | |
{ | |
String yr = Date.today().addYears(1).year().format().replaceAll(',', ''); | |
system.debug('year: ' + yr); | |
FiscalYearSettings fys = [select StartDate from FiscalYearSettings where name = :yr limit 1]; | |
Date Q1Start = fys.StartDate; |
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
//==================================================================== | |
// Name: MicroserviceManagerDemo | |
// Type: Class | |
// Purpose: Demo routines for demoing the MicroserveManager | |
// Created by: Don Robins | |
// Created on: Dec 1, 2017 | |
//==================================================================== | |
// Setup Steps: (NOTE- Run this in Classic, NOT in Lightning Experience as Attachments are deprecated.) | |
// 1) Clone the PFDParser Repo and deploy to a Heroku instance from: | |
// https://github.com/forcementor/pdf-convert.git |
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
//==================================================================== | |
// Name: MicroserviceManager | |
// Type: Class | |
// Purpose: Routines for managing setup and calls to a microservice | |
// Created by: Don Robins | |
// Created on: Dec 1, 2017 | |
//==================================================================== | |
public class MicroserviceManager { | |
//Endpoint as Named Credential for the PDF Parser service. |
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
//THIS IS THE FLAWED CODE! | |
//Listen for exceptions observed by the proxy so we can report them and clean up. | |
Ext.getStore('Leads').getProxy().addListener('exception', function (proxy, response, operation, options) { | |
// only certain kinds of errors seem to have useful information returned from the server | |
if (response.data) { | |
if (response.data.errorMessage) { | |
Ext.Msg.alert('Error', response.data.errorMessage); | |
} else { | |
Ext.Msg.alert('Error', operation.action + ' failed: ' + response.data.message); | |
} |
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
@RemoteAction | |
public static Response Query(QueryRequest qr) { | |
Response resp = new Response(); | |
//Enforce a limit on the number of rows requested. | |
final integer QUERY_LIMIT = 500; | |
if (qr.start >= QUERY_LIMIT) { | |
resp.success = false; | |
resp.errorMessage = 'Maximum number of records (' + String.valueOf(QUERY_LIMIT) + ') exceeded!'; |
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 void getAllLeads(QueryRequest qr, Response resp) { | |
//Page size is set in the Sencha store as recordCount. | |
Integer pageSize = qr.recordCount; | |
//Page number will be calculated. | |
Integer pageNumber = 0; | |
//Start is the record number indicating the start of the page. | |
if (qr.start > 0) { |
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 List < Lead > getAllLeads() { | |
return [SELECT | |
FirstName, LastName, Company, Title, Phone, MobilePhone, Email, Status | |
FROM Lead LIMIT 50]; | |
} |
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
@RemoteAction | |
public static Response Query(QueryRequest qr) { | |
Response resp = new Response(); | |
List < Lead > LeadList; | |
filterString = qr.searchFilter; | |
try { | |
//Fetch all Leads for the user | |
LeadList = getAllLeads(); | |
} catch (Exception e) { |
NewerOlder