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 controller="AccountMultipleSearchWithPagenationCLS" action="{!searchAcc}" > | |
<script type="text/javascript"> | |
window.onload=function() { | |
// document.getElementById("{!$Component.thePb.thepbs.accName}").focus(); | |
} | |
</script> | |
<apex:form > | |
<apex:pageBlock id="thePb" title="Account Details To Search"> | |
<apex:pageblockSection id="thepbs"> | |
<apex:inputField value="{!acc.Created_From_Date__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
public with sharing class AccountMultipleSearchWithPagenationCLS { | |
public Account acc{get;set;} | |
public List<Account> accountList {get;set;} | |
// create a list of strings to hold the conditions | |
List<string> conditions = new List<string>(); | |
private integer totalRecs = 0; | |
private integer OffsetSize = 0; | |
private integer LimitSize= 10; | |
public AccountMultipleSearchWithPagenationCLS(){ |
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
<messaging:emailTemplate subject="Opportunities to verify" recipientType="Contact" relatedToType="Account"> | |
<messaging:htmlEmailBody > | |
Good Morning! Here are the opporunities that needs verification. <br/><br/> | |
<c:OpportunitiesToVerify accountIdValue="{!relatedTo.Id}" /> | |
ref: {!relatedTo.id} | |
</messaging:htmlEmailBody> |
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:component access="global" controller="OppsWithMatches"> | |
<apex:attribute name="accountIdValue" type="String" description="This is the Id of the account" assignTo="{!accountId}" access="global" /> | |
<table class="table"> | |
<thead> | |
<tr> | |
<th>Opportunity Name</th> | |
<th>Opportunity Description</th> | |
<th>Opportunity Amount</th> |
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
global with sharing class OppsWithMatches{ | |
global List<Opportunity> Opps{get;set;} | |
global String accountId{get;set;} | |
global account account{ | |
get { | |
Account = [Select Id, name from Account where id =: accountId]; | |
return account; } | |
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
// Query the accounts to lock | |
Account[] accts = [SELECT Id from Account WHERE Name LIKE 'Acme%']; | |
// Lock the accounts | |
Approval.LockResult[] lrList = Approval.lock(accts, false); | |
// Iterate through each returned result | |
for(Approval.LockResult lr : lrList) { | |
if (lr.isSuccess()) { | |
// Operation was successful, so get the ID of the record that was processed | |
System.debug('Successfully locked account with ID: ' + lr.getId()); |
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 OppTrigger on Opportunity (after insert, before update) { | |
Map<String, Id> typeMap = New Map<ID,RecordType>(); | |
for(RecordType rt: [Select ID, DeveloperName From RecordType Where sObjectType = 'Opportunity']) { | |
typeMap.put(rt.DeveloperName, rt.id); | |
} | |
for (Opportunity opp : trigger.new) { | |
// And the Agreement Category on the record = TEST | |
if (opp.Stage__c == 'Negotiation/Review') { |
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<Account> accList = [SELECT id,type,customer_type__c FROM account WHERE type!=null LIMIT 200]; | |
for(account a:accList){ | |
a.customer_type__c = a.type; | |
} | |
update accList; |
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 ApprovalProcessor { | |
webservice void submitAndProcessApprovalRequest() { | |
// Create an approval request for the account | |
Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest(); | |
req1.setComments('Submitting request for approval.'); | |
req1.setObjectId(a.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
//product1 | |
Product2 p = new Product2(); | |
p.Name = 'Test Product'; | |
p.Description = 'Test desc'; | |
p.IsActive = true; | |
insert p; | |
//standard price book entry for Product p | |
PricebookEntry pbe1 = new PricebookEntry(); | |
pbe1.Pricebook2Id = Test.getStandardPricebookId(); |
OlderNewer