• Paul Brainard
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 3
    Replies

We have a custom built CRM for case management in Salesforce. I believe the only two standard objects we're using are the Contacts and Organizations (Accounts).

We are looking at adding NPSP for all the other cool things it has:

  1. Accounting Subledger
  2. Donor Management
  3. Campaign Management
  4. In-Kind Donation Management
  5. Grant Management
  6. Volunteer Management
Is it common for organizations to add NPSP to existing salesforce builds and how feasible is it?

Why would I be getting this error?
Element type "apex:image" must be followed by either attribute specifications, ">" or "/>"

Here's the code:

<apex:image value="{!$Resource.house_yellow}" alt="Case Status = Intake or Waitlisted" rendered="{!Participant_Case__c.Status__c == 'Intake' || Participant_Case__c.Status__c == 'Referred to Program' || Participant_Case__c.Status__c == 'Waitlisted'}"style="max-height:30px;" Title="Needs to be Enrolled"/>

What is the best way to convert the following button in Classic to a Lightning component (or other option):

{!REQUIRESCRIPT("/soap/ajax/24.0/connection.js")} 

var newRecords = []; 

var IR = new sforce.SObject("Incident_Report__c"); 
IR.id ="{!Incident_Report__c.Id}"; 
IR.Generate_Incident_Report__c =  1; 
newRecords.push(IR); 

result = sforce.connection.update(newRecords);
alert("Incident Report:\nPlease refresh the page if you do not see the new Incident Report document created under Notes & Attachments");
window.location.reload();

Please, and thank you!

Paul
Hello Good People,

I want to be able to filter on a notes field on an object.  Currently, the code below is passing a date range from a VF page into an Extension and it's filtering the notes by the date range.  I want to be able to filter further by adding a multi-value picklist on a field called Activities Offered, so the PDF prints just the notes between the date range and for the Activities Offered on the Participant Activity.  I've tried adding the variable stractoff references in the below code, but the result is now showing no notes at all.  Can anyone see what I'm doing wrong and lend a helping hand?
 
public with sharing class CaseNotesController {
// The controller has three modes that it can be invoked
// 1. to specify the date range of case notes to print out for a case (PrintCaseNotes.page)
// 2. to load a single case note to print out for a participant activity (CaseNotesViewPDF)
// 3. to a range of case notes to print out for a case (CaseNotesViewPDF after PrintCaseNotes)

 List<Participant_Activity__c> palist = new List<Participant_Activity__c>();
  
 public Datetime starttime { get ; set; }
 public Datetime endtime { get ; set; }
  
 public String strstarttime { get ; set; }
 public String strendtime { get ; set; }
 
public String stractoff { get ; set; }

 public String getstartdate () {
     if (starttime != null) {
        Date d = date.newinstance(starttime.year(), starttime.month(), starttime.day());
        return d.format();
     } else {
        return null;
     }
 }
  public String getenddate () {
      if (endtime != null) {
        Date d = date.newinstance(endtime.year(), endtime.month(), endtime.day());
        return d.format();
      } else {
        return null;
     }
 }
 
public Participant_Activity__c singlepa {get; set;}
 
 public Program__c program {get;set;}
 public Participant_Case__c c {get;set;}
 
 String cid; // case id that may be passed in via the URL
 String paid; // participant activity id that may be passed in
 
 // wrapper class to contain participant activities and related hours
 public class parActivity {
        public Participant_Activity__c pa {get; set;}
        public List<Participant_Hours__c> phs {get; set;}
        public List<Staff_Hours__c> shs {get; set;}       
        public String padate {get;set;}
        public Integer num {get;set;}
        public Integer shssize {get;set;}
        public Integer phssize {get;set;}
 }
 
 public CaseNotesController(ApexPages.StandardController sc) { 

        c = (Participant_Case__c) sc.getRecord();
        if (c==null || c.id == null) 
                cid = ApexPages.currentPage().getParameters().get('id');        // we should always have a cid
            else
                cid = c.id;

        // get command line params
        strstarttime = ApexPages.currentPage().getParameters().get('starttime');
            strendtime = ApexPages.currentPage().getParameters().get('endtime'); 
             stractoff = ApexPages.currentPage().getParameters().get('stractoff');        
            paid = ApexPages.currentPage().getParameters().get('paid'); // we will only have a paid when invoked from the Participant Activity page
            
            // if a case id is passed in but no paid or starttime, just load the latest PA if there is one
            system.debug('TESTING>>> cid: ' + cid + ', paid: '+paid+', strstarttime: ' + strstarttime);
            if (cid != null && (paid == null || paid.length() < 15) && strstarttime == null) {
                system.debug('DEBUG>>> Only CID passed in. Loading latest PA.');
                try {
                                paid = [select id from Participant_Activity__c where Case__c =:cid order by Start_Time__c desc limit 1].id;             
                } catch (QueryException e) {
                        system.debug(e.getMessage());
                }
            }
            
            // check for next invocation case: invoked from case record            
            if (cid == null && (paid == null || paid.length() < 15)) {
                system.debug('DEBUG>>> Case Notes Controller: No Ids passed in.');
            } else {
        
                CaseManagement cm = new CaseManagement(c);
                program = cm.program;  
                        
                if ((paid == null || paid.length() < 15) && (strstarttime!=null && strendtime!=null)) { // invoked from the Case page
                
                if (strstarttime != null) 
                    starttime = datetime.valueof(strstarttime);
                
                if (strendtime != null) 
                    endtime = datetime.valueof(strendtime);

                singlepa = new Participant_Activity__c (  // in this case this is only used to hold the date range
                    Start_Time__c = starttime,
                    End_Time__c = endtime,
                    Activities_Offered__c = stractoff
                );
                
        } else {  // invoked from the Participant Activity page -- printing single case note
                try {
                    singlepa = [select id, Case_Notes__c, Start_Time__c, Contact_Method_Location__c, Duration_hours__c, End_Time__c, Clinical_Status_WNL_Appearance__c, 
                                    Clinical_Status_Poor_Hygiene__c, Clinical_Status_Poor_Grooming__c, Clinical_Status_WNL_Mood__c, Clinical_Status_Depressed__c, 
                                    Clinical_Status_Angry__c, Clinical_Status_Excitable__c, Clinical_Status_Anxious__c, Clinical_Status_WNL_Affect__c,
                                    Clinical_Status_Flat__c, Clinical_Status_Bright__c, Clinical_Status_Sad__c, Clinical_Status_Expressive__c, Clinical_Status_Good__c,
                                    Clinical_Status_Poor__c, Clinical_Status_Minimal__c, Clinical_Status_Fixed_Gaze__c, Clinical_Status_WNL_Activity_Level__c,
                                    Clinical_Status_Hyperactive__c, Clinical_Status_Agitated__c, Clinical_Status_Slowed__c, Clinical_Status_Medication__c,
                                    Clinical_Status_UAs__c, Clinical_Status_Other_Observations__c, Service_Type__c, Case__c, Activities_Offered__c,
                                    (select id, Staff__c, Duration__c, Service_Code__c, Bill_Code__c from Staff_Hours__r),
                                    (select id, Participant__c, Participant__r.DEM_Family_Role__c, Main_Participant__c, Duration__c, Service_Code__c, Bill_Code__c, Type__c 
                                            from Participant_Hours__r)
                                            //where Participant__c =:c.Participant__c)
                                    from Participant_Activity__c 
                                            where id=:paid limit 1];
                } catch (QueryException e) {
                    system.debug('DEBUG>> No Participant Activities found.');
                } catch (NullPointerException e) {
                    system.debug('DEBUG>> Null Pointer Exception querying for Participant Activities.');
                }
                
                if (singlepa != null) {
                    starttime = singlepa.Start_Time__c;
                    endtime = singlepa.End_Time__c;
                }
                
        }
    }
 } 

 public List<parActivity> activities;
   
 public List<parActivity> getactivities() {
            
     activities = new List<parActivity>(); 
     system.debug('TESTING>>> getactivities: paid ' + paid + ', singlepa: ' + singlepa);
        
     if ((paid != null && paid.length() < 15) && singlepa != null && singlepa.Start_Time__c != null) {  // populate one pa
        parActivity pact = new parActivity();
        pact.pa = singlepa;
        pact.num = 1;
        pact.padate = pact.pa.Start_Time__c.format('M/d/yyyy','PST');
        pact.shs = singlepa.Staff_Hours__r;
        pact.shssize = singlepa.Staff_Hours__r.size();
        pact.phs = singlepa.Participant_Hours__r;
        pact.phssize = singlepa.Participant_Hours__r.size();
        activities.add(pact);
     } else { // load multiple from date range
        // get the participant activities
        Integer o = 0;
        for (Participant_Activity__c pa : [select id, Case_Notes__c, Start_Time__c, Contact_Method_Location__c, Duration_hours__c, End_Time__c, Clinical_Status_WNL_Appearance__c, 
                                Clinical_Status_Poor_Hygiene__c, Clinical_Status_Poor_Grooming__c, Clinical_Status_WNL_Mood__c, Clinical_Status_Depressed__c, 
                                Clinical_Status_Angry__c, Clinical_Status_Excitable__c, Clinical_Status_Anxious__c, Clinical_Status_WNL_Affect__c,
                                Clinical_Status_Flat__c, Clinical_Status_Bright__c, Clinical_Status_Sad__c, Clinical_Status_Expressive__c, Clinical_Status_Good__c,
                                Clinical_Status_Poor__c, Clinical_Status_Minimal__c, Clinical_Status_Fixed_Gaze__c, Clinical_Status_WNL_Activity_Level__c,
                                Clinical_Status_Hyperactive__c, Clinical_Status_Agitated__c, Clinical_Status_Slowed__c, Clinical_Status_Medication__c,
                                Clinical_Status_UAs__c, Clinical_Status_Other_Observations__c, Service_Type__c, Case__c,
                                (select id, Staff__c, Duration__c, Service_Code__c, Bill_Code__c from Staff_Hours__r),
                                (select id, Participant__c, Participant__r.DEM_Family_Role__c, Main_Participant__c, Duration__c, Service_Code__c, Bill_Code__c, Type__c 
                                        from Participant_Hours__r) 
                                        //where Participant__c =:c.Participant__c)
                          from Participant_Activity__c 
                          where Case__r.id =:cid 
                          and Start_Time__c>=:starttime 
                          and Start_Time__c<=:endtime
                          order by Start_Time__c]) {
 
                        parActivity pact = new parActivity();
                        pact.padate = pa.Start_Time__c.format('M/d/yyyy','PST');
                        pact.pa = pa;
                        pact.num = o++;
                        pact.shs = pa.Staff_Hours__r;
                        if (pa.Staff_Hours__r != null)
                                pact.shssize = pa.Staff_Hours__r.size();
                        else
                                pact.shssize = 0;
                        pact.phs = pa.Participant_Hours__r;
                        if (pa.Participant_Hours__r != null)
                                pact.phssize = pa.Participant_Hours__r.size();
                        else
                                pact.phssize = 0;
                        activities.add(pact);           
                                        
        }
        // also load the participant hours from the group activities and translate them into participant activities
        for (Participant_Hours__c ph : [select id, Participant__c, Participant__r.DEM_Family_Role__c, Main_Participant__c, Duration__c, Service_Code__c, Bill_Code__c, 
                                                                                Case_Notes__c, Type__c, Start_Time__c, End_Time__c  
                                                                        from Participant_Hours__c
                                                                        where Case__c =: cid 
                                                                        and Group_Meeting__c != null
                                                                        and Start_Time__c>=:starttime 
                                                                        and Start_Time__c<=:endtime
                                                                        and Activities_Offered__c=: stractoff 
                                                                        order by Start_Time__c ]) {
                                                                                
                        parActivity pact = new parActivity();
                        List<Participant_Hours__c> phs = new List<Participant_Hours__c>();
                        Participant_Activity__c pa = new Participant_Activity__c();
                        pa.Start_Time__c = ph.Start_Time__c;
                        pa.End_Time__c = ph.End_Time__c;
                        pa.Case_Notes__c = ph.Case_Notes__c;
                        pa.Case__c = null;  // this is how we tell the page that these are not real PAs
                        pact.pa = pa;
                        pact.shs = null;
                        pact.shssize = 0;
                        pact.phssize = 0;
                        pact.num = o++;
                        phs.add(ph);
                        pact.phs = phs;
                        pact.phssize = 1;
                        activities.add(pact);           
                                        
        }
     }
     
     return activities;
 } 
 
 public Integer listSize {
        
        get {
                return activities.size();
        }
        
        set;}
 
 public PageReference LoadPDF() {

     //PageReference pdf = new PageReference('/apex/AssessmentViewPDF?id=' + AssessmentTaken.id);
     PageReference pdf = new Pagereference('/apex/CaseNotesViewPDF?id='+cid+'&starttime='+singlepa.Start_Time__c+'&endtime='+singlepa.End_Time__c);
     pdf.setRedirect(true);
     return pdf;
 }



 
I want to be able to say If tempc.Status is not equal to 'Active' OR 'Intake', how would that statement look?  I've tried a bunch of different ways and nothing is working.

 // make sure the case is active or in intake status
        if(tempc.Status__c != 'Active') {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'The case you selected is not in Intake or Active. Please only select Intake/Active Cases or create a new one.'));
            return null;
            }
I have a table created in Apex that returns as part of a VF page.  The table extends to the right forcing users to scroll back and forth.  Is there a way to adjust the width of the table, or modify it to create two rows where there is only one now?

Here is the Apex code:

 public Component.Apex.PageBlockTable getDropInBlockTable() {
        Component.Apex.OutputField outputField;
        Component.Apex.InputField inputField;
        Component.Apex.Column column;
        
        // create the table
      Component.Apex.PageBlockTable table = new Component.Apex.PageBlockTable(var='p', id='casetable');
      table.expressions.value='{!diplist}';
        
        // select checkbox
        Component.Apex.InputCheckbox selectbox= new Component.Apex.InputCheckbox();
        selectbox.expressions.value = '{!p.selected}';
        column = new Component.Apex.Column(headerValue='Select');
        column.childComponents.add(selectbox);
        table.childComponents.add(column);
        
        // participant case link and a label for it
        Component.Apex.outputLabel outlab = new Component.Apex.outputLabel();
        outlab.expressions.value='{!p.c.Name}';
        Component.Apex.OutputLink caselink = new Component.Apex.OutputLink(target='_blank', id='caselink', title='View Case');  
        caselink.expressions.value='/{!p.c.id}';
        
        //outlab.expressions.for='{!p.c.id}';
        caselink.childComponents.add(outlab);
        column = new Component.Apex.Column(headerValue='Case');
        column.childComponents.add(caselink);
        table.childComponents.add(column);
        
        // Add the Contact fields
        for(Schema.FieldSetMember fsm : getContactFields()) {
            inputField = new Component.Apex.InputField();
            inputField.expressions.value = '{!p.con.' + fsm.getFieldPath() + '}'; 
            system.debug('TESTING>>> contact inputField.expressions.value: ' + inputField.expressions.value);
            column = new Component.Apex.Column(headerValue=fsm.getLabel());
            column.childComponents.add(inputField);
            table.childComponents.add(column);
        }
        
        // Add the Direct Service fields
        for(Schema.FieldSetMember fsm : getDSFields()) {
            inputField = new Component.Apex.InputField();
            system.debug('TESTING>>> ds inputField.expressions.value: ' + inputField.expressions.value);
            inputField.expressions.value = '{!p.ds.' + fsm.getFieldPath() + '}'; 
            column = new Component.Apex.Column(headerValue=fsm.getLabel());
            column.childComponents.add(inputField);
            table.childComponents.add(column);
        }

        return table;
}
I would expect this to be straightforward but I keep getting an error saying one of my dates doesn't exist.  I've got a report type that joins two tables and I want to be able to subtract a date from one from a date from the other.  I'm using the Add Formula function on a report and using this convention:

assessment_date__c - enrollment_date__c

I get an error that says assessment_date__c doesn't exist.  I'm kind of new, so please be kind.  :)

 

Why would I be getting this error?
Element type "apex:image" must be followed by either attribute specifications, ">" or "/>"

Here's the code:

<apex:image value="{!$Resource.house_yellow}" alt="Case Status = Intake or Waitlisted" rendered="{!Participant_Case__c.Status__c == 'Intake' || Participant_Case__c.Status__c == 'Referred to Program' || Participant_Case__c.Status__c == 'Waitlisted'}"style="max-height:30px;" Title="Needs to be Enrolled"/>

Hello Good People,

I want to be able to filter on a notes field on an object.  Currently, the code below is passing a date range from a VF page into an Extension and it's filtering the notes by the date range.  I want to be able to filter further by adding a multi-value picklist on a field called Activities Offered, so the PDF prints just the notes between the date range and for the Activities Offered on the Participant Activity.  I've tried adding the variable stractoff references in the below code, but the result is now showing no notes at all.  Can anyone see what I'm doing wrong and lend a helping hand?
 
public with sharing class CaseNotesController {
// The controller has three modes that it can be invoked
// 1. to specify the date range of case notes to print out for a case (PrintCaseNotes.page)
// 2. to load a single case note to print out for a participant activity (CaseNotesViewPDF)
// 3. to a range of case notes to print out for a case (CaseNotesViewPDF after PrintCaseNotes)

 List<Participant_Activity__c> palist = new List<Participant_Activity__c>();
  
 public Datetime starttime { get ; set; }
 public Datetime endtime { get ; set; }
  
 public String strstarttime { get ; set; }
 public String strendtime { get ; set; }
 
public String stractoff { get ; set; }

 public String getstartdate () {
     if (starttime != null) {
        Date d = date.newinstance(starttime.year(), starttime.month(), starttime.day());
        return d.format();
     } else {
        return null;
     }
 }
  public String getenddate () {
      if (endtime != null) {
        Date d = date.newinstance(endtime.year(), endtime.month(), endtime.day());
        return d.format();
      } else {
        return null;
     }
 }
 
public Participant_Activity__c singlepa {get; set;}
 
 public Program__c program {get;set;}
 public Participant_Case__c c {get;set;}
 
 String cid; // case id that may be passed in via the URL
 String paid; // participant activity id that may be passed in
 
 // wrapper class to contain participant activities and related hours
 public class parActivity {
        public Participant_Activity__c pa {get; set;}
        public List<Participant_Hours__c> phs {get; set;}
        public List<Staff_Hours__c> shs {get; set;}       
        public String padate {get;set;}
        public Integer num {get;set;}
        public Integer shssize {get;set;}
        public Integer phssize {get;set;}
 }
 
 public CaseNotesController(ApexPages.StandardController sc) { 

        c = (Participant_Case__c) sc.getRecord();
        if (c==null || c.id == null) 
                cid = ApexPages.currentPage().getParameters().get('id');        // we should always have a cid
            else
                cid = c.id;

        // get command line params
        strstarttime = ApexPages.currentPage().getParameters().get('starttime');
            strendtime = ApexPages.currentPage().getParameters().get('endtime'); 
             stractoff = ApexPages.currentPage().getParameters().get('stractoff');        
            paid = ApexPages.currentPage().getParameters().get('paid'); // we will only have a paid when invoked from the Participant Activity page
            
            // if a case id is passed in but no paid or starttime, just load the latest PA if there is one
            system.debug('TESTING>>> cid: ' + cid + ', paid: '+paid+', strstarttime: ' + strstarttime);
            if (cid != null && (paid == null || paid.length() < 15) && strstarttime == null) {
                system.debug('DEBUG>>> Only CID passed in. Loading latest PA.');
                try {
                                paid = [select id from Participant_Activity__c where Case__c =:cid order by Start_Time__c desc limit 1].id;             
                } catch (QueryException e) {
                        system.debug(e.getMessage());
                }
            }
            
            // check for next invocation case: invoked from case record            
            if (cid == null && (paid == null || paid.length() < 15)) {
                system.debug('DEBUG>>> Case Notes Controller: No Ids passed in.');
            } else {
        
                CaseManagement cm = new CaseManagement(c);
                program = cm.program;  
                        
                if ((paid == null || paid.length() < 15) && (strstarttime!=null && strendtime!=null)) { // invoked from the Case page
                
                if (strstarttime != null) 
                    starttime = datetime.valueof(strstarttime);
                
                if (strendtime != null) 
                    endtime = datetime.valueof(strendtime);

                singlepa = new Participant_Activity__c (  // in this case this is only used to hold the date range
                    Start_Time__c = starttime,
                    End_Time__c = endtime,
                    Activities_Offered__c = stractoff
                );
                
        } else {  // invoked from the Participant Activity page -- printing single case note
                try {
                    singlepa = [select id, Case_Notes__c, Start_Time__c, Contact_Method_Location__c, Duration_hours__c, End_Time__c, Clinical_Status_WNL_Appearance__c, 
                                    Clinical_Status_Poor_Hygiene__c, Clinical_Status_Poor_Grooming__c, Clinical_Status_WNL_Mood__c, Clinical_Status_Depressed__c, 
                                    Clinical_Status_Angry__c, Clinical_Status_Excitable__c, Clinical_Status_Anxious__c, Clinical_Status_WNL_Affect__c,
                                    Clinical_Status_Flat__c, Clinical_Status_Bright__c, Clinical_Status_Sad__c, Clinical_Status_Expressive__c, Clinical_Status_Good__c,
                                    Clinical_Status_Poor__c, Clinical_Status_Minimal__c, Clinical_Status_Fixed_Gaze__c, Clinical_Status_WNL_Activity_Level__c,
                                    Clinical_Status_Hyperactive__c, Clinical_Status_Agitated__c, Clinical_Status_Slowed__c, Clinical_Status_Medication__c,
                                    Clinical_Status_UAs__c, Clinical_Status_Other_Observations__c, Service_Type__c, Case__c, Activities_Offered__c,
                                    (select id, Staff__c, Duration__c, Service_Code__c, Bill_Code__c from Staff_Hours__r),
                                    (select id, Participant__c, Participant__r.DEM_Family_Role__c, Main_Participant__c, Duration__c, Service_Code__c, Bill_Code__c, Type__c 
                                            from Participant_Hours__r)
                                            //where Participant__c =:c.Participant__c)
                                    from Participant_Activity__c 
                                            where id=:paid limit 1];
                } catch (QueryException e) {
                    system.debug('DEBUG>> No Participant Activities found.');
                } catch (NullPointerException e) {
                    system.debug('DEBUG>> Null Pointer Exception querying for Participant Activities.');
                }
                
                if (singlepa != null) {
                    starttime = singlepa.Start_Time__c;
                    endtime = singlepa.End_Time__c;
                }
                
        }
    }
 } 

 public List<parActivity> activities;
   
 public List<parActivity> getactivities() {
            
     activities = new List<parActivity>(); 
     system.debug('TESTING>>> getactivities: paid ' + paid + ', singlepa: ' + singlepa);
        
     if ((paid != null && paid.length() < 15) && singlepa != null && singlepa.Start_Time__c != null) {  // populate one pa
        parActivity pact = new parActivity();
        pact.pa = singlepa;
        pact.num = 1;
        pact.padate = pact.pa.Start_Time__c.format('M/d/yyyy','PST');
        pact.shs = singlepa.Staff_Hours__r;
        pact.shssize = singlepa.Staff_Hours__r.size();
        pact.phs = singlepa.Participant_Hours__r;
        pact.phssize = singlepa.Participant_Hours__r.size();
        activities.add(pact);
     } else { // load multiple from date range
        // get the participant activities
        Integer o = 0;
        for (Participant_Activity__c pa : [select id, Case_Notes__c, Start_Time__c, Contact_Method_Location__c, Duration_hours__c, End_Time__c, Clinical_Status_WNL_Appearance__c, 
                                Clinical_Status_Poor_Hygiene__c, Clinical_Status_Poor_Grooming__c, Clinical_Status_WNL_Mood__c, Clinical_Status_Depressed__c, 
                                Clinical_Status_Angry__c, Clinical_Status_Excitable__c, Clinical_Status_Anxious__c, Clinical_Status_WNL_Affect__c,
                                Clinical_Status_Flat__c, Clinical_Status_Bright__c, Clinical_Status_Sad__c, Clinical_Status_Expressive__c, Clinical_Status_Good__c,
                                Clinical_Status_Poor__c, Clinical_Status_Minimal__c, Clinical_Status_Fixed_Gaze__c, Clinical_Status_WNL_Activity_Level__c,
                                Clinical_Status_Hyperactive__c, Clinical_Status_Agitated__c, Clinical_Status_Slowed__c, Clinical_Status_Medication__c,
                                Clinical_Status_UAs__c, Clinical_Status_Other_Observations__c, Service_Type__c, Case__c,
                                (select id, Staff__c, Duration__c, Service_Code__c, Bill_Code__c from Staff_Hours__r),
                                (select id, Participant__c, Participant__r.DEM_Family_Role__c, Main_Participant__c, Duration__c, Service_Code__c, Bill_Code__c, Type__c 
                                        from Participant_Hours__r) 
                                        //where Participant__c =:c.Participant__c)
                          from Participant_Activity__c 
                          where Case__r.id =:cid 
                          and Start_Time__c>=:starttime 
                          and Start_Time__c<=:endtime
                          order by Start_Time__c]) {
 
                        parActivity pact = new parActivity();
                        pact.padate = pa.Start_Time__c.format('M/d/yyyy','PST');
                        pact.pa = pa;
                        pact.num = o++;
                        pact.shs = pa.Staff_Hours__r;
                        if (pa.Staff_Hours__r != null)
                                pact.shssize = pa.Staff_Hours__r.size();
                        else
                                pact.shssize = 0;
                        pact.phs = pa.Participant_Hours__r;
                        if (pa.Participant_Hours__r != null)
                                pact.phssize = pa.Participant_Hours__r.size();
                        else
                                pact.phssize = 0;
                        activities.add(pact);           
                                        
        }
        // also load the participant hours from the group activities and translate them into participant activities
        for (Participant_Hours__c ph : [select id, Participant__c, Participant__r.DEM_Family_Role__c, Main_Participant__c, Duration__c, Service_Code__c, Bill_Code__c, 
                                                                                Case_Notes__c, Type__c, Start_Time__c, End_Time__c  
                                                                        from Participant_Hours__c
                                                                        where Case__c =: cid 
                                                                        and Group_Meeting__c != null
                                                                        and Start_Time__c>=:starttime 
                                                                        and Start_Time__c<=:endtime
                                                                        and Activities_Offered__c=: stractoff 
                                                                        order by Start_Time__c ]) {
                                                                                
                        parActivity pact = new parActivity();
                        List<Participant_Hours__c> phs = new List<Participant_Hours__c>();
                        Participant_Activity__c pa = new Participant_Activity__c();
                        pa.Start_Time__c = ph.Start_Time__c;
                        pa.End_Time__c = ph.End_Time__c;
                        pa.Case_Notes__c = ph.Case_Notes__c;
                        pa.Case__c = null;  // this is how we tell the page that these are not real PAs
                        pact.pa = pa;
                        pact.shs = null;
                        pact.shssize = 0;
                        pact.phssize = 0;
                        pact.num = o++;
                        phs.add(ph);
                        pact.phs = phs;
                        pact.phssize = 1;
                        activities.add(pact);           
                                        
        }
     }
     
     return activities;
 } 
 
 public Integer listSize {
        
        get {
                return activities.size();
        }
        
        set;}
 
 public PageReference LoadPDF() {

     //PageReference pdf = new PageReference('/apex/AssessmentViewPDF?id=' + AssessmentTaken.id);
     PageReference pdf = new Pagereference('/apex/CaseNotesViewPDF?id='+cid+'&starttime='+singlepa.Start_Time__c+'&endtime='+singlepa.End_Time__c);
     pdf.setRedirect(true);
     return pdf;
 }



 
I would expect this to be straightforward but I keep getting an error saying one of my dates doesn't exist.  I've got a report type that joins two tables and I want to be able to subtract a date from one from a date from the other.  I'm using the Add Formula function on a report and using this convention:

assessment_date__c - enrollment_date__c

I get an error that says assessment_date__c doesn't exist.  I'm kind of new, so please be kind.  :)