This file contains hidden or 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 Map<String,Set<String>> parseCsv(Integer numRecords){ | |
//csvFile is public Blob member variable... | |
String csvData = csvFile.ToString(); | |
csvData = csvData.replace('"',''); | |
List<String> records = csvData.split('\r?\n'); | |
Map<String,Set<String>> ans = ... | |
//Start at 1 to skip header row | |
for(Integer i=1; i < records.size() && (numRecords == null || i <= numRecords); i++){ |
This file contains hidden or 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:commandLink action="{!downloadTemplate}" target="blank" value="Download CSV Template" /> |
This file contains hidden or 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="CustomSettingController"> | |
<apex:pageMessages id="msgs" /> | |
<apex:form id="theform"> | |
<apex:inputField value="{!cs.Field1__c}" /> | |
<apex:inputField value="{!cs.Field2__c}" /> | |
<apex:commandButton value="{!$Label.CSTab_Save}" action="{!update}" rerender="msgs,theform" /> | |
</apex:form> | |
</apex:page> |
This file contains hidden or 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
/** | |
* P2_BatchProcessController | |
* @description VF controller class for a VF tab | |
* allowing user to select a batch / schedule apex job | |
* and execute it immediately | |
* @author dancinllama | |
* @date 4/17/2012 | |
*/ | |
public class P2_BatchProcessController { | |
This file contains hidden or 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 static Account createPortalAccount(){ | |
User u = [Select Id From User Where Id=:UserInfo.getUserId()]; | |
Id roleId = [Select Id From UserRole Where PortalType='None' Limit 1].Id; | |
User accountOwner = null; | |
System.runAs(u){ | |
Map<String,Object> acctOwnerInputParams = new Map<String,Object>(); | |
acctOwnerInputParams = new Map<String,Object>(); | |
acctOwnerInputParams.put('UserRoleId',roleId); | |
acctOwnerInputParams.put('Username','[email protected]'); |
NewerOlder