• blucas
  • 5 Points
  • Member since 2014
  • Director of Application Development
  • Affordable Life Plans

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 4
For a given record, how could I go about getting all the fields in that object (schema describe?) and back up field specific data for a record. The use case would be, if I deleted a record, could I backup all fields and associated values into a text file or something? Would want it to be scalable so that if I added a new field, I wouldn't have to modify the code everytime.

I have a encrypted custom field. I want this field to be shown as plain text in an e mal template. I am using the apex outputField  <messaging:attachment >
Encrypted Account Number: <apex:outputField value="{!relatedTo.ts2__Employee__r.Sample_Bank_Acc__c}"/>
However the field remaims encypted in the e mail attachment. 
Does anyone know a way around this??
i have written this method but it keeps giving me this error :
Error: Compile Error: Variable does not exist: childOpps at line 14 column 23

public class StandardControllerExtension {
Account acct;
public StandardControllerExtension (ApexPages.standardController std)
acct = (Account)std.getRecord();
public List<Opportunity> getChildOpps() {
return [Select Name, Amount, StageName, CloseDate From Opportunity
Where AccountId = :acct.Id
and (IsWon = true or IsClosed = false)];
private void createTaskOnChildOpps () {
List<Task> tasksToInsert = new List<Task> ();
for (Opportunity opp : childOpps) {
if (!opp.isClosed) {
tasksToInsert.add (
new Task(
WhatId = Opp.Id,
OwnerId = opp.OwnerId,
ActivityDate =Date.today () + 3,
Status = 'Not Started',
Subject = 'Send follow-up email to pirmary contact'
if (tasksToInsert.size() >0 )insert taskToInsert;
public PageReference save() {
if (acct.Rating =='Hot') {
update acct;
return new PageReference ('/' + acct.Id);

can anyone help me with this ? 

Non-developer needs help!  I am trying to create a custom button with javascript to create records on a list view.  The new records are Invoices that are details of master-detail relationships to Programs and Accounts.


The Create New Invoice button is on the Programs list view.  The Account is a lookup field within the Program and it is called Billing_Account__c.  The button will work if I hard code a Account Id into "newInvoice.Billing_Account__c = "xxxx";" but otherwise I can't get it to work.  Any ideas?


Also, are there any other best practices that I should incorporate in the button, such as "8 Programs were selected, but only 4 Invoices were created."?


Thanks in advance.


var url = parent.location.href;
var records = {!GETRECORDIDS($ObjectType.Program__c)};
var newRecords = [];

if (records[0] == null) {
alert("Please select at least one record to update.");
} else {
for (var a=0; a<records.length; a++) {
var newInvoice = new sforce.SObject("Invoice__c");
newInvoice.Program__c = records[a];
newInvoice.Billing_Account__c = "{!Program__c.Billing_AccountId__c}"; //This line is the problem
result = sforce.connection.create(newRecords);
parent.location.href = url; //refresh the page