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 ViewStateStudy_controller { | |
public String accId{get;set;} | |
public Account account{get;set;} | |
public ViewStateStudy_controller() | |
{ | |
accId = ApexPages.currentPage().getParameters().get('Id'); | |
if(accId != 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
trigger HandleProductPriceChange on Merchandise__c (after update) { | |
List<Line_Item__c> openLineItems = | |
[SELECT j.Unit_Price__c, j.Merchandise__r.Price__c | |
FROM Line_Item__c j | |
WHERE j.Invoice__r.Status__c = 'Negotiating' | |
AND j.Merchandise__r.id IN :Trigger.new | |
FOR UPDATE]; | |
for (Line_Item__c li: openLineItems) { |
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
In this exercise, you will create a trigger that will address the problem of people creating | |
bad topics in your org. We will create logic to remove bad topics from chatter posts and replace them | |
with good topics. | |
The trigger executes on the TopicAssignment object on insert. It then attempts to delete the bad | |
TopicAssignment record and insert a new one. Because the trigger is on insert and also calls insert | |
we risk the problem of a recursive trigger, which must be addressed by using a variable to maintain the | |
execution state of the trigger. | |
1. Top prepopulate our "good" topics, run the following execute anonymous code: |
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 gist is meant to work through some examples of using Visualforce with Salesforce1. It uses the following features and libraries: | |
Features | |
- Visualforce...of course | |
- Apex remote method | |
- Canvas publisher JS API | |
Libs | |
- onestarter - for S1 look and feel (https://github.com/joshbirk/onestarter) | |
- jQuery - dependency for onestarter |
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<Audit_Request__c> ars = Database.query('select id from Audit_Request__c where isDeleted=true ALL ROWS'); | |
System.debug(ars.size()); | |
Database.emptyRecycleBin(ars); | |
List<Audit_Request__c> ars2 = Database.query('select id from Audit_Request__c where isDeleted=true ALL ROWS'); | |
System.debug(ars2.size()); |
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
// The old smiley function from the previous step | |
function smiley(x, y) { | |
moveTo(x, y); | |
color("yellow"); | |
circle(0, 0, 50); | |
color("black"); | |
circle(-20, 10, 7); | |
circle(20, 10, 7); | |
lineWidth(3); | |
path("g -20 -10 q 20 -10 0 -50 c"); |
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
require 'getoptlong' | |
data_file = 'data.txt' | |
words_to_generate = 10 | |
min_length = 3 | |
max_length = 9 | |
opts = GetoptLong.new( | |
["--datafile", "-d", GetoptLong::OPTIONAL_ARGUMENT], |
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
Candidate__c cand = new Candidate__c(first_name__c = 'Sammy', last_name__c = 'Bakersfield', email__c ='s@bakersfield.com'); | |
insert cand; | |
// the following 3 lines are special; for testing SOSL in testMethods | |
// see the Apex PDF for more info on SOSL in testMethods | |
Id [] fixedSearchResults = new Id[] {cand.id}; | |
Test.setFixedSearchResults(fixedSearchResults); | |
// now we do the controller's sosl search | |
extension.doSearch(); | |
// verify the results of the search |
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
<apex:page showHeader="false" title="New Order" standardController="Service_Order__c"> | |
<apex:composition template="{!$Site.Template}"> | |
<apex:define name="body"> | |
... | |
<apex:form styleClass="form" > | |
<apex:pageMessages id="styledError"/> | |
<apex:messages id="unstyledError"/> | |
... |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> | |
<types> | |
<members>*</members> | |
<name>ApexClass</name> | |
</types> | |
<types> | |
<members>*</members> | |
<name>ApexComponent</name> | |
</types> |
OlderNewer