• Cheri L.
  • NEWBIE
  • 0 Points
  • Member since 2016
  • Principal
  • The Strategic Org


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
New to trigger writing, and would be grateful for some help.
  • Two custom objects: Session (parent) and Session Participants (child). (nb: The sessions are children of the parent Program; we have 30+ programs with weekly sessions.) 
  • A new Session is created by Process Builder when a Workflow marks the previous Session Completed. I want the new Session's creation to trigger the populating of the new Session's list of participants (who can change from week to week).
Issues —
  1. I want to loop through Contacts to create a list of students who match the newly created Session particulars — the SOQL query (which is throwing a ton of errors, mostly on the operators and brackets).
  2. Each student on the list should then be created as a new Session Participant for the new Session.
I plan to create a similar Trigger whenever a Contact is inserted or updated to add them to the Session Participant list as well, but I think I can work that out if I can make this trigger work.
 
trigger SessParticList on Session__c (after insert, after update) {
//    List<Session_Participants__c> newParticList = [SELECT Name, ID FROM Contact 
//  			 WHERE npsp__Primary_Affiliation__c = Session_Participants__r.Session__r.Program_Name__c 
//					AND Session_Day__c = Session_Participants__r.Session__r.Day_of_the_Week__c
//					AND Session_Timing__c = Session_Participants__r.Session__r.Session_Timing__c
//					AND Active__c = TRUE
//					AND ((Program_Role__c = 'Student' AND Permission_Obtained__c = TRUE) 
//               	   OR Program_Role__c = 'Volunteer')];
    for (Session__c sess : Trigger.new){
		if(sess.Completed__c = FALSE && sess.Session_Date__c >= Date.today()) {
//      insert newParticList;
    	}
    }
}
Thank you for any help you can provide!
Novice developer here, trying to adapt Trailhead code  (https://trailhead.salesforce.com/content/learn/modules/lex_javascript_button_migration/javascript_button_alternatives)to a somewhat similar use for class attendance. I want the following to happen —
  1. user clicks multiple boxes on a list view of enrollees
  2. user then clicks a Visualforce button ("Mark Present") to update the Attended checkbox on each record (also shown on the listview)
  3. the listview then shows all the checked boxes with minimal obvious refreshing, and definitely no new page returning
Here's the listview (with the button that isn't functioning properly) — 
Listview with non-working button in place
And here's my code that doesn't work as I want it to —
<apex:page standardController="Session_Participation__c" recordSetVar="attendees">
   <apex:form >
      <apex:pageBlock title="Mark Present" mode="edit">
         
          <apex:pageBlockTable value="{!selected}" var="att" id="attended">
            <apex:column value="{!att.Enrollee__c}"/>
            <apex:column value="{!att.Attended__c}"/>
              <apex:inputField value="{!att.Attended__c}"/>
               <apex:actionSupport event="onclick" 
                                   immediate="true" action="{!save}"/>
          </apex:pageBlockTable>

       </apex:pageBlock>
   </apex:form>
</apex:page>
I'd be grateful for help!

 
My summary custom object should present a set of checkboxes that reflect whether or not the "finished" checkbox is checked on other custom objects. But my formula is getting is syntax error that Request__r doesn't exist, though that's the correct name of the custom object I want to reference — IF(Request__r.FORM_COMPLETE__c, TRUE,FALSE). That's wrong here?
New to trigger writing, and would be grateful for some help.
  • Two custom objects: Session (parent) and Session Participants (child). (nb: The sessions are children of the parent Program; we have 30+ programs with weekly sessions.) 
  • A new Session is created by Process Builder when a Workflow marks the previous Session Completed. I want the new Session's creation to trigger the populating of the new Session's list of participants (who can change from week to week).
Issues —
  1. I want to loop through Contacts to create a list of students who match the newly created Session particulars — the SOQL query (which is throwing a ton of errors, mostly on the operators and brackets).
  2. Each student on the list should then be created as a new Session Participant for the new Session.
I plan to create a similar Trigger whenever a Contact is inserted or updated to add them to the Session Participant list as well, but I think I can work that out if I can make this trigger work.
 
trigger SessParticList on Session__c (after insert, after update) {
//    List<Session_Participants__c> newParticList = [SELECT Name, ID FROM Contact 
//  			 WHERE npsp__Primary_Affiliation__c = Session_Participants__r.Session__r.Program_Name__c 
//					AND Session_Day__c = Session_Participants__r.Session__r.Day_of_the_Week__c
//					AND Session_Timing__c = Session_Participants__r.Session__r.Session_Timing__c
//					AND Active__c = TRUE
//					AND ((Program_Role__c = 'Student' AND Permission_Obtained__c = TRUE) 
//               	   OR Program_Role__c = 'Volunteer')];
    for (Session__c sess : Trigger.new){
		if(sess.Completed__c = FALSE && sess.Session_Date__c >= Date.today()) {
//      insert newParticList;
    	}
    }
}
Thank you for any help you can provide!
Hi All,

I want to integrate salesforce with bitly. With this integration need to generate short url from salesforce and track the summary (like clicks, location etc,.) of short url in salesforce.

Thanks in Advance,
Narendra
Hi,

I have created a formula in a work flow to concatenate several fields to for a new field in opportunities, this works however for the date, I would like the day to show as two digits for day 1-9 in the month but I cannot seem to figure out how to update my formula (below) to manage this. The result I am looking to achieve is where a call date is 09/09/2017 should be returned as 09SEP17.

Thanks in advance
Aidan

Product2.ProductCode + '-' + Opportunity.Port__r.Port_Code__c + '-' + Opportunity.Ship__r.Code__c + '-' + 
TEXT(DAY(Opportunity.Call_Date__c)) + CASE(MONTH(Opportunity.Call_Date__c), 
1, "JAN", 
2, "FEB", 
3, "MAR", 
4, "APR", 
5, "MAY", 
6, "JUN", 
7, "JUL", 
8, "AUG", 
9, "SEP", 
10, "OCT", 
11, "NOV", 
12, "DEC", 
"None") + RIGHT(TEXT(YEAR(Opportunity.Call_Date__c)),2)