├── ConnectRESTAPI.html ├── LightningComponents ├── HotelReview │ ├── HotelReview.app │ ├── HotelReviewController.js │ └── HotelReviewHelper.js ├── HotelReviewerClass.cls ├── author.cmp ├── bootstrap.min.css ├── newHotel │ ├── newHotel.cmp │ ├── newHotelController.js │ └── newHotelHelper.js └── visitedHotels.cmp ├── Live-Agent ├── deployment-API │ ├── deployment-code.js │ └── login.html └── pre-chat-api │ └── prechatform.html ├── README.md └── UseRESTAPI.html /ConnectRESTAPI.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

REST API With Javascript

7 | 8 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /LightningComponents/HotelReview/HotelReview.app: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 10 |
11 | 12 |



13 | 14 |



15 | 16 | 17 | 18 |
19 | -------------------------------------------------------------------------------- /LightningComponents/HotelReview/HotelReviewController.js: -------------------------------------------------------------------------------- 1 | ({ 2 | showHotels : function(component, event, helper) { 3 | helper.executeControllerMethod(component); 4 | } 5 | }) 6 | -------------------------------------------------------------------------------- /LightningComponents/HotelReview/HotelReviewHelper.js: -------------------------------------------------------------------------------- 1 | ({ 2 | executeControllerMethod : function(component) { 3 | var classMethod = component.get("c.getExistingHotelRecords"); 4 | classMethod.setCallback(this,function(response){ 5 | if(response.state === 'SUCCESS'){ 6 | component.set("v.hotels",response.getReturnValue()); 7 | } 8 | }); 9 | $A.enqueueAction(classMethod); 10 | } 11 | }) 12 | -------------------------------------------------------------------------------- /LightningComponents/HotelReviewerClass.cls: -------------------------------------------------------------------------------- 1 | public class HotelReviewerClass { 2 | 3 | @AuraEnabled 4 | public static List getExistingHotelRecords(){ 5 | return [SELECT Id,Name,Website__c,Phone__c,Visit_Date__c FROM Hotel__c]; 6 | } 7 | 8 | @AuraEnabled 9 | public static void createNewHotel(Hotel__c hotelRecord){ 10 | insert hotelRecord; 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /LightningComponents/author.cmp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {!v.FirstName} - {!v.year} 5 | 6 | -------------------------------------------------------------------------------- /LightningComponents/newHotel/newHotel.cmp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |
17 | 21 | 25 | 29 | 33 | 34 |
35 |
36 | 37 | 38 | Hotel Review successfully created 39 | 40 | 41 | 42 | 43 | An error has occurred. Contact IT help desk 44 | 45 | 46 |
47 |
48 |
49 | -------------------------------------------------------------------------------- /LightningComponents/newHotel/newHotelController.js: -------------------------------------------------------------------------------- 1 | ({ 2 | submitHotel : function(component, event, helper) { 3 | var newHotel = component.get("v.newHotel"); 4 | helper.callControllerMethod2(component,newHotel); 5 | } 6 | }) 7 | -------------------------------------------------------------------------------- /LightningComponents/newHotel/newHotelHelper.js: -------------------------------------------------------------------------------- 1 | ({ 2 | callControllerMethod : function(component,newHotel) { 3 | 4 | var classMethod = component.get("c.createNewHotel"); 5 | classMethod.setParams({ 6 | "hotelRecord":newHotel 7 | }); 8 | classMethod.setCallback(this,function(response){ 9 | if(response.state === "SUCCESS"){ 10 | component.set("v.hotelCreatedSuccess",true); 11 | }else{ 12 | component.set("v.hotelCreatedFail",true); 13 | } 14 | }); 15 | $A.enqueueAction(classMethod); 16 | } 17 | }) 18 | -------------------------------------------------------------------------------- /LightningComponents/visitedHotels.cmp: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |

Hotel Name: 5 | 6 |

7 |

Website: 8 | 9 |

10 |

Visit Date: 11 | 12 |

13 |
14 |
15 | -------------------------------------------------------------------------------- /Live-Agent/deployment-API/deployment-code.js: -------------------------------------------------------------------------------- 1 | //get the user's email address from local storage 2 | var email = localStorage.getItem('liveAgentEmail'); 3 | //add a custom detail named email using the email variable 4 | liveagent.addCustomDetail('email',email); 5 | //add two other custom details for case subject and case status 6 | liveagent.addCustomDetail('caseStatus','New'); 7 | liveagent.addCustomDetail('caseSubject','Portal Case: '); 8 | //we will find or create a contact record 9 | liveagent.findOrCreate('Contact'); 10 | //find a contact where the email address matches the value 11 | //of the customDetail named email, do not perform exact match 12 | //and do not create a new contact 13 | liveagent.findOrCreate('Contact').map('email','email',true,false,false); 14 | //once the contact is found add it to the contact lookup on the chat transcript record 15 | liveagent.findOrCreate('Contact').saveToTranscript('Contact'); 16 | //link the contact to a new case by the contactId lookup field 17 | liveagent.findOrCreate('Contact').linkToEntity('Case','ContactId'); 18 | //find or create a new case 19 | liveagent.findOrCreate('Case'); 20 | //create a new case and populate the status and subject fields using the customDetails 21 | liveagent.findOrCreate('Case').map('Status','caseStatus',false,false,true).map('Subject','caseSubject'); 22 | //once the case is created display it in the console 23 | liveagent.findOrCreate('Case').showOnCreate(); 24 | //attach the case to the transcript via the case lookup field 25 | liveagent.findOrCreate('Case').saveToTranscript('CaseId'); 26 | -------------------------------------------------------------------------------- /Live-Agent/deployment-API/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Login Page

8 | 9 | 10 |

11 | 12 | 13 |

14 | 15 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Live-Agent/pre-chat-api/prechatform.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 16 |

Chat with Support

17 |

Enter your details below

18 |
19 | 20 | 21 |

22 | 23 | 24 |

25 | 26 | 27 |

28 | What do you need help with: 32 |

33 | 35 | 37 | 39 | 41 | 42 | 44 | 46 | 48 | 49 | 51 | 52 | 54 | 55 | 57 | 59 | 61 |

62 | 63 |
64 | 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SFDC-Projects 2 | 3 | Personal projects exposing SFDC development capabilities. 4 | -------------------------------------------------------------------------------- /UseRESTAPI.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

REST API With Javascript

7 |

Create Account Record

8 | 9 | 10 |

11 | 12 |
13 | 97 | 98 | 99 | --------------------------------------------------------------------------------