• Jude Morin 3
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
I'm essentially trying to re-create a Roll-Up Summary field using a Scheduled Apex Job. I can't use a Roll-Up Summary because some formula fields do now shup up in my filters. (Open to suggestions)

Here is my code, short and simple but too many queries because of the For Select statement I imagine. What is a best practice for doing what I am attempting? 
Global class Attendance_this_FY implements Schedulable
{
	Global void execute(SchedulableContext sc)
    {
        // get list of current and past program participants
        list<Contact> conlist = [SELECT id 
                                 FROM Contact 
                                 WHERE Program_begin_date__c != null];
        
        // for each contact select count from attendance and update contact
        for (Contact con : conlist)
        {
            con.Number_of_Services_This_FY__c = [SELECT count() 
                                                 FROM attendance__c 
                                                 WHERE Program_Participant__c = :con.Id
                                                 AND Service__c = true
                                                 AND this_fiscal_year__c = true];
        }
        
        update conlist;
    }
}


 
I want to count the number of child records that were created within 90 days of the master record begin date. Is there a way to pass a Master Record variable to the filter of the roll-up summary? Or is there a more elegent way of getting this data? 
I have a list button that sends me to a vf page to email the selected records. However list buttons do not work in communities, but I need the same functionality. Is there an alternative to list buttons functionality for communities? 
I'm essentially trying to re-create a Roll-Up Summary field using a Scheduled Apex Job. I can't use a Roll-Up Summary because some formula fields do now shup up in my filters. (Open to suggestions)

Here is my code, short and simple but too many queries because of the For Select statement I imagine. What is a best practice for doing what I am attempting? 
Global class Attendance_this_FY implements Schedulable
{
	Global void execute(SchedulableContext sc)
    {
        // get list of current and past program participants
        list<Contact> conlist = [SELECT id 
                                 FROM Contact 
                                 WHERE Program_begin_date__c != null];
        
        // for each contact select count from attendance and update contact
        for (Contact con : conlist)
        {
            con.Number_of_Services_This_FY__c = [SELECT count() 
                                                 FROM attendance__c 
                                                 WHERE Program_Participant__c = :con.Id
                                                 AND Service__c = true
                                                 AND this_fiscal_year__c = true];
        }
        
        update conlist;
    }
}


 
Hello,

Following the winter release winter 0. How is it possible to check if the org is well on the winter 20 and also at what date was it done.
thank you 
  • October 22, 2019
  • Like
  • 0
We've been working with the NPSP Package for over a year, it has suddenly started directing people to the Welcome Page for NPSP.

There is no option in the window to move back to SF - only to Learn with Trailhead / Join the Community - no options at all to get back to the Force. 

Has anyone seen this before or know how to stop it from doing this?

User-added image
Hi Guys,

we have a custom button of List Type which redirects to a visualforce page, this button is working in lightning, but when it comes to lightning community i can see the button in community but when you clicks on button its does nothig.

can you guys please help me out here to resolve this issue.

Thanks in advance.