• mw6
  • NEWBIE
  • 185 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 30
    Replies
I want to sent the a report on Cases using workflow to another person who does'nt have salesforce account, is it possible
I have created an email template which have the link to the report
 
  • October 24, 2017
  • Like
  • 0
I have the below trigger

I am using another trigger to create a person account when a new student is created.  After this when the student enroll to a course, a new class allocation is created in 'Class_Allocation__c object.  Once this record is created, I want to copy the contact.id into a lookup field 'Related_Contact__c' on Class_Allocation__C, not sure what is wrong with the trigger.

From Student__C  when a person account is created, I am storing ID (Salesforce) and Student ID into Contact fields Salesforce_Id_from_Student_Object__c, Student_Id_from_Student_Prospects__c fields.  I am using the Student_Name__C field from class_allocation__c to match from Contact 'Student_Id_from_Student_Prospects__c'

No error, and the 'Related_Contact__C on Class_Allocation__c (look up) is not getting populated.  Can anybody help on this

trigger Updatecontactidonclassallocation on Class_Allocation__c (after insert) {
    Set<Id> AllocIds = new Set<Id>();
    for (Class_Allocation__c dReg : Trigger.new)
        AllocIds.add(dReg.Student_Name__C);
     map<id, contact> userContact =
                new map<id, contact>([SELECT Id,Student_Id_from_Student_Prospects__c,Salesforce_Id_from_Student_Object__c FROM contact
                                   WHERE Student_Id_from_Student_Prospects__c IN:AllocIds]);
    for(Class_Allocation__c o: trigger.new){
        if(o.Related_Contact__C == '') {
            o.Related_Contact__C = userContact.get(o.ID).Id;
        }
    }
}


 
  • September 17, 2017
  • Like
  • 0
I have a custom object called 'Class_Allocation__c' and have a lookup field on this object called 'Related_Contact__c.  I need expert help to write a trigger on Class_Allocation__c to auto copy the contact Id into this field based on 'Student__Name__c' field on Class_Allocation__C and Student_id_from_Student_object__c (on contact)
  • September 15, 2017
  • Like
  • 1
I have an object called Student__c with a field 'Related_Contact__c', I have written a trigger which creates a Person account when a new record is created on Student__c.  After the Person Account is created, I want to copy the PERSONCONTACTID or contactid back into the Student__c object, can anybody help to write a trigger .

When creating a person account, I am copying the ID of from Student__c to person account 'Salesforce_id_from_Student__c and Name field into Student_id_from_student__c
  • September 14, 2017
  • Like
  • 0
I want to send the Timba survey from a custom object, is ti possible,  for example when the payment is made and the status of invoice is fully paid, then the survey need to send out, survey and email tempalte is created in salesforce
  • September 11, 2017
  • Like
  • 0
I have the below trigger to create Person Account when a new record is created in a custom object Student__c

I would like to seek some expert help on how to modify the trigger to have 'after update' if the record on Student__c is modified, the changes also should be done on the corresponding person account.

The external ID field on Student__c is Student_id__c and also unique field is NRIC__c. I also store the Id from Student__c into Person Account (Student_Id_from_Student_Prospects__pc,NRIC_PC, Salesforce_Id_from_Student_Object__pc

Please help to modify the below trigger to have 'after insert' and 'after update'
-------------------
trigger CreatePersonAccountfromStudent on Student__c (after insert)
{
    List<account> acc=new List<account>();
    Map<Id, String> m = new Map<Id, String>();
    RecordType rt = [select id from RecordType where SobjectType='Account' and Name='Student' Limit 1];
    for(student__c stud:Trigger.New)
    {
      acc.add(new account(
        Autocreated__pc=True,
        Block__pc=Stud.Block__c,
        Bulk_Load__pc=Stud.Bulk_Load__c,
        Current_Acedamic_Year__pc=Stud.Current_Acedamic_Year__c,
        Date_of_Collection__pc=Stud.Date_of_Collection__c,
        Discount_Percentage__pc=Stud.Discount_Percentage__c,
        Discount_Policy__pc=Stud.Discount_Policy__c,
        Discount_Remarks__pc=Stud.Discount_Remarks__c,
        Discount_Type__pc=Stud.Discount_Type__c,
        English__pc=Stud.English__c,
        Event_Name__pc=Stud.Event_Name__c,
        Exclude_Registration__pc=Stud.Exclude_Registration__c,
        Father_Email__pc=Stud.Father_Email__c,
        Father_Name__pc=Stud.Father_Name__c,
        Father_NRIC__pc=Stud.Father_NRIC__c,
        Father_Office_Phone__pc=Stud.Father_Office_Phone__c,
        Father_Primary_Contact__pc=Stud.Father_Primary_Contact__c,
        Father_Remark__pc=Stud.Father_Remark__c,
        Father_Staff__pc=Stud.Father_Staff__c,
        Gender__pc=Stud.Gender__c,
        GEP__pc=Stud.GEP__c,
        Guardian_Email__pc=Stud.Guardian_Email__c,
        Guardian_Mobile__pc=Stud.Guardian_Mobile__c,
        Guardian_Name__pc=Stud.Guardian_Name__c,
        Guardian_NRIC__pc=Stud.Guardian_NRIC__c,
        Guardian_Office_Phone__pc=Stud.Guardian_Office_Phone__c,
        Guardian_Primary_Contact__pc=Stud.Guardian_Primary_Contact__c,
        Guardian_Relationship__pc=Stud.Guardian_Relationship__c,
        Guardian_Remarks__pc=Stud.Guardian_Remark__c,
        Guardian_Staff__pc=Stud.Guardian_Staff__c,
        How_did_you_hear_about_us__pc=Stud.How_did_you_hear_about_us__c,
        Is_Mind_Stretcher_Staff_Mother__pc=Stud.Is_Mind_Stretcher_Staff_Mother__c,
        LastName=Stud.name__c,
        Level__pc=Stud.Level__c,
        Level_Promoted_DateTime__pc=Stud.Level_Promoted_DateTime__c,
        Maths__pc=Stud.Maths__c,
        Mobile_No_Father__pc=Stud.Mobile_No_Father__c,
        Mother_Email__pc=Stud.Mother_Email__c,
        Mother_Name__pc=Stud.Mother_Name__c,
        Mother_No_Mobile__pc=Stud.Mobile_No_Mother__c,
        Mother_NRIC__pc=Stud.Mother_NRIC__c,
        Mother_Office_Phone__pc=Stud.Mother_Office_Phone__c,
        Mother_Primary_Contact__pc=Stud.Mother_Primary_Contact__c,
        Mother_Remark__pc=Stud.Mother_Remark__c,
        Mother_Staff__pc=Stud.Mother_Staff__c,
        MS_Start_Kit_Bag__pc=Stud.MS_Start_Kit_Bag__c,
        Nationality__pc=Stud.Nationality__c,
        NRIC__pc=Stud.NRIC__c,
        NTUC_10_Discount__pc=Stud.NTUC_10_Discount__c,
        NTUC_Card_Expiry__pc=Stud.NTUC_Card_Expiry__c,
        NTUC_Remark__pc=Stud.NTUC_Remark__c,
        Others__pc=Stud.Others__c,
        Others_How_did_you_hear_about_us__pc=Stud.Others_How_did_you_hear_about_us__c,
        Person_Contact__pc=Stud.Person_Contact__c,
        PersonBirthdate=Stud.DOB__c,
        PersonHomePhone=Stud.Home_No__c,
        PersonMailingPostalCode=Stud.Postal_Code__c,
        PersonMailingStreet=Stud.Street_Temp__C,
        Primary_Contact_Number__pc=Stud.Contact_number__c,
        Primary_Email__pc=Stud.Primary_Email__c,
        Primary_Name__pc=Stud.Primary_Name__c,
        Primary_Remark__pc=Stud.Primary_Remark__c,
        Promotion__pc=Stud.Promotion__c,
        Reading_Oceans_Email__pc=Stud.Reading_Oceans_Email__c,
        Reading_Oceans_End_Date__pc=Stud.Reading_Oceans_End_Date__c,
        Reading_Oceans_Start_Date__pc=Stud.Reading_Oceans_Start_Date__c,
        Reading_Oceans_Subscrip__pc=Stud.Reading_Oceans_Subscrip__c,
        recordtypeid=rt.id,
        Registration_Centre__pc=Stud.Registration_Centre__c,
        Related_Centres__pc=Stud.Related_Centres__c,
        Remarks__pc=Stud.Remarks__c,
        RO_Date_Send_User__pc=Stud.RO_Date_Send_User__c,
        RO_Remark__pc=Stud.RO_Remark__c,
        RO_Type__pc=Stud.RO_Type__c,
        Safra_Card_Expiry__pc=Stud.Safra_Card_Expiry__c,
        Safra_Card_Holding__pc=Stud.Safra_Card_Holding__c,
        Safra_Remark__pc=Stud.Safra_Remark__c,
        Salesforce_Id_from_Student_Object__pc=Stud.ID,
        School__pc=Stud.School__c,
        Science__pc=Stud.Science__c,
        Secondary_Stream__pc=Stud.Secondary_Stream__c,
        Start_Date__pc=Stud.Start_Date__c,
        Street__pc=Stud.Street__c,
        Student_Id_from_Student_Prospects__pc=Stud.name,
        Student_Old_Reference_ID__pc=Stud.Student_Old_Reference_ID__c,
        Student_Status__pc=Stud.Student_Status__c,
        Student_Type__pc='Student',
        Tick_to_activate_inter_branch_discount__pc=Stud.Tick_to_activate_inter_branch_discount__c,
        Type_Course_Fee__pc=Stud.Type_Course_Fee__c,
        Unit_Number__pc=Stud.Unit_Number__c
    ));
 }
    insert acc;
}
  • July 24, 2017
  • Like
  • 0
Hi,

I have a visualforce page  with a button 'RCA' and when I click this I need to open a add new record screen for an object 'RCA__c', is it possible, please help
  • July 21, 2017
  • Like
  • 0
I have the below VF Page with 10 custom buttons,
<apex:page id="TeacherKPI_VF" controller="TeacherKPI_VF_Controller">
  <apex:form >
  <div style="text-align:center;">
      <h1 style="text-decoration: underline;">TEACHER'S KPI</h1><br/><br/>
      <apex:commandButton value="Lesson Observation" action="{!LessonObservation_VF}"/><br/><br/>
      <apex:commandButton value="File Check" action="{!FileCheck_VF}"/><br/><br/>
      <apex:commandButton value="Request for Corrective Action" action="{!RequestforCorrectiveAction_VF}"/><br/><br/>
      <apex:commandButton value="Withdrawal Trend" action="{!WithdrawalTrend_VF}"/><br/><br/>              
      <apex:commandButton value="Cost Recoverability Index" action="{!CostRecoverabilityIndex_VF}"/><br/><br/>
      <apex:commandButton value="Teacher Parent Dialogue Log" action="{!TeacherParentDialogueLog_VF}"/><br/><br/>
      <apex:commandButton value="Training sessions" action="{!TrainingSessions_VF}"/><br/><br/>
      <apex:commandButton value="Parent's Survey" action="{!ParentSurvey_VF}"/><br/><br/>
      <apex:commandButton value="Student's Survey" action="{!StudentSurvey_VF}"/><br/><br/>
      <apex:commandButton value="Leave / MC" action="{!LeaveMC_VF}"/><br/><br/>
      <apex:commandButton value="Back" action="{!Back}"/>      
  </div>
  </apex:form>
</apex:page>

When any of the button is click, need to open another VF PAGEs for example
<apex:commandButton value="Lesson Observation" action="{!LessonObservation_VF}"/><br/><br/> need to open VF Page LessonObservation_VF, I am not sure on how to do this, please help

The Class is not complete yet
public with sharing class TeacherKPI_VF_Controller {

    public PageReference Back() {
        return null;
    }

    public PageReference LeaveMC_VF() {
        return null;
    }

    public PageReference StudentSurvey_VF() {
        return null;
    }

    public PageReference ParentSurvey_VF() {
        return null;
    }

    public PageReference TrainingSessions_VF() {
        return null;
    }

    public PageReference TeacherParentDialogueLog_VF() {
        return null;
    }


    public PageReference CostRecoverabilityIndex_VF() {
        return null;
    }

    public PageReference WithdrawalTrend_VF() {
        return null;
    }

    public PageReference RequestforCorrectiveAction_VF() {
        return null;
    }

    public PageReference FileCheck_VF() {
        return null;
    }

    public PageReference LessonObservation_VF() {
        return null;
    }

}

 
  • July 19, 2017
  • Like
  • 0
Hi

I have attached a screenshot, I need help to create a VF Page same as the attached picture, so that from each button I can call different class to do data entry
User-added image
  • July 19, 2017
  • Like
  • 0
I have a trigger and when running hit the below error. not sure how to fix this, requesting expert help.

Error:Apex trigger updateReliefTeacheronTeacherClassSession caused an unexpected exception, contact your administrator: updateReliefTeacheronTeacherClassSession: execution of AfterUpdate caused by: System.QueryException: Non-selective query against large object type (more than 200000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): Trigger.updateReliefTeacheronTeacherClassSession: line 14, column 1

trigger updateReliefTeacheronTeacherClassSession on Staff_Leave__c (after insert, after update)
    {
        map<string, Staff_Leave__c> ObjMap = new map<string, Staff_Leave__c>();
        DateTime myDateTime;
        String dayOfWeek;
        
  
        for(Staff_Leave__c obj: Trigger.new)
        {   List<Class__c> classList = [SELECT Id,Day__c from Class__c where id =: obj.Active_Class__c];
            
            if (obj.Relief_Teacher__c != Null)
            {   myDateTime = (DateTime)obj.date_of_leave__c;
                dayOfWeek = myDateTime.format('E');
                
                for(Class__c classRec:classList)
                {
                    if(dayOfWeek != classRec.day__c)
                    {
                       obj.addError('Please check leave dates.'); 
                    }
                    else
                    {
                        ObjMap.put(obj.Teacher__c, obj);
                    }
                }
                System.debug('-----Teacher is = '+ obj.Teacher__c + ' ------');
            }
        }
         
        List<Teacher_Class_Session__c> T = [SELECT Id,Teacher__c, Staff_Leave__c ,Assigned_Teacher__c,Relief_Type__c , Class__c,Class__r.teacher__c, Session_Date__c, Attendant_Status__c FROM Teacher_Class_Session__c WHERE Class__r.teacher__c IN :ObjMap.KeySet()];
        List<Teacher_Class_Session__c> TUpdateList = new List<Teacher_Class_Session__c>();
         
        for(Teacher_Class_Session__c c: T)
        {   System.debug('----------- Iterating through all class sessions-----');
            
            Staff_Leave__c obj = ObjMap.get(c.class__r.teacher__c);
            System.debug('Class session id = '+ c.id);
            System.debug('c.teacher= ' + c.class__r.teacher__c);
            System.debug('obj teacher= ' +obj.teacher__c);
            System.debug('c.class= ' + c.class__c + ' ' + 'obj class= ' +obj.Active_Class__c );
            System.debug('c.date= ' + c.session_date__c + ' ' + 'obj class= ' +obj.date_of_leave__c);
                        
            if(obj.Teacher__c == c.Class__r.teacher__c && obj.Active_Class__c == c.Class__c && c.session_date__c == obj.date_of_leave__c)
            { System.debug('Match found');
             c.Teacher__c = obj.Relief_Teacher__c;
             c.Relief_Type__c = obj.Leave_Type__c;
             c.Attendant_Status__c= 'Relief';
             c.Staff_Leave__c = obj.id;
             tUpdateList.add(c);
             }
         
           
        }
     
        if(tUpdateList.size() > 0)
        {
            update tUpdateList;
        }
        
    }
  • July 18, 2017
  • Like
  • 0
I have a field called 'Expiry_Date__C.  Can anybody help me to write a formula to populate the last date of this to a date field using formula
  • June 29, 2017
  • Like
  • 0
I have a VF page with a button 'Transfer', if this button is clicked, a new pop up window need to appear with 3 picklist fields (Transfer_Category__c, Transfer_Category_Type__c,Transfer Category_Sub_Type__C).  once the valuse are selected and click 'Ok' button the controller need to go back to the original Page  Can anybody helps
  • June 21, 2017
  • Like
  • 0
Hi 

I have an object with the following fields.  I need help to write an html / VF email tempalte to display this details in columns 1, 2, 3, 4, 5,6,7,8,9

Object Name: Staff_Leave__c
---------------------------
Column 1. Centre__c
Column 2. Date_of_Leave__c
Column 3. Date_of_approval__c
Column 4. Day__c    
Column 5. Leave_Type__c    
Column 6. Teacher__c    
Column 7. Teacher_Phone_Number__c    
Column 8. Relief_Teacher__c    
Column 9. Relief_Teacher_Phone_Number__c

Please help
 
  • June 12, 2017
  • Like
  • 0
Hi 

I would like to change the default fields displayed in the list of campaign members on the Add Campaign members screen as per attached.  Is there a way to permanantly change those fields to my custom fields Attached the screenshot
  • May 09, 2017
  • Like
  • 0
We have a custom object called Staff__c and Staff_Leave__c.  I need to sent an email to a record in Staff__c when his leave record in Staff_Leave__c is approved by changing the Leave_Status__c to 'Approvved'.  Is there a way to do this please advice
  • April 27, 2017
  • Like
  • 0
I have a Picklist field on Case called Type with values 'Teacher Related, Policy Feedback, Curriculum Feedback' I have another field called Teacher_Name__c.  I need some help to write a validation rule so that if the user select the either 'Policy Feedback' or 'Curriculum Feedback' The teacher_name__c field should be made non editable and when the user choose 'Teacher Related' the Teacher_Name__c should be allowed to choose the teacher name.
  • April 18, 2017
  • Like
  • 0
I have the fields "Base_Price__c", Discount_Percentage__c, Discount_Amount__c.  I need to calculate the discounted price either by $ or percentage.  I need some help to write a formula to have either one discount or no discount, please help
  • April 18, 2017
  • Like
  • 0
How to write a salesforce formula to convert the field Date_of_Withdrawal_String__c (text) field which has he data as "2017-04-30 00:00:00" into a Date field to show the date as 30/04/2017.
  • April 03, 2017
  • Like
  • 0
Hi 

We are awarding points for the payments made.  I have a issued date (Points_Issue_Date__c) and Expiry date (Points_Expiry_Date__c). When a record is created in this object (Loyalty_Points__c) 
If the issued date is between 1/12/2016 - 30/11/2017 the expiry date is set as 30/11/2018
If the issued date is between 1/12/2017 - 30/11/2018 the expiry date is set as 30/11/2019
and goes on. In shor I need to set the expiry date is set as 2 years from issue date, but if the issue date goes forward, the expiry date will not change.

Any body can help
  • March 28, 2017
  • Like
  • 0
Hi 

Can any expert help me to create a formula to calculate the # of weeks in the current month ro create a formula field

Thanks in adv
  • January 10, 2017
  • Like
  • 0
I have a custom object called 'Class_Allocation__c' and have a lookup field on this object called 'Related_Contact__c.  I need expert help to write a trigger on Class_Allocation__c to auto copy the contact Id into this field based on 'Student__Name__c' field on Class_Allocation__C and Student_id_from_Student_object__c (on contact)
  • September 15, 2017
  • Like
  • 1
Hi I have created below trigger to create the contact when a case is inserted via web-to-case.  There is no error, and I am not sure why the contact is not getting created.  I have only one custom field on contact to mark as auto created, rest all are standard fields. Can anybody help to figure out the issue.. 

trigger AutocreateContactfromCase on Case (before insert) {
    List<String> emailAddresses = new List<String>();
    for (Case caseObj:Trigger.new) {
        if (caseObj.ContactId==null && caseObj.SuppliedEmail!='')
        {
            emailAddresses.add(caseObj.SuppliedEmail);
             
        }
    }
    List<Contact> listContacts = [Select Id, Email From Contact Where Email in :emailAddresses];
    Set<String> takenEmails = new Set<String>();
    for (Contact c:listContacts) {
        takenEmails.add(c.Email);
    }
    Map<String,Contact> emailToContactMap = new Map<String,Contact>();
    List<Case> casesToUpdate = new List<Case>();
    for (Case caseObj:Trigger.new) {
        if (caseObj.ContactId==null &&
            caseObj.SuppliedName!=null &&
            caseObj.SuppliedName!='' &&
            caseObj.SuppliedEmail!=null &&
            caseObj.SuppliedEmail!='' &&             
            caseObj.SuppliedPhone!=null &&
            caseObj.SuppliedPhone!='' &&            
            !takenEmails.contains(caseObj.SuppliedEmail))
         {
            String[] nameParts = caseObj.SuppliedName.split(' ',2);
            if (nameParts.size() == 2)
            {
                Contact cont = new Contact(FirstName=nameParts[0],
                                            LastName=nameParts[1],
                                            Email=caseObj.SuppliedEmail,
                                            Phone=caseObj.SuppliedPhone,
                                            Autocreated__c=true);
                emailToContactMap.put(caseObj.SuppliedEmail,cont);
                casesToUpdate.add(caseObj);
            }
        }
    }
    List<Contact> newContacts = emailToContactMap.values();
    insert newContacts;
    for (Case caseObj:casesToUpdate) {
        Contact newContact = emailToContactMap.get(caseObj.SuppliedEmail);
        caseObj.ContactId = newContact.Id;
    }
}
 
  • October 05, 2016
  • Like
  • 1
I have an object called Student__c with a field 'Related_Contact__c', I have written a trigger which creates a Person account when a new record is created on Student__c.  After the Person Account is created, I want to copy the PERSONCONTACTID or contactid back into the Student__c object, can anybody help to write a trigger .

When creating a person account, I am copying the ID of from Student__c to person account 'Salesforce_id_from_Student__c and Name field into Student_id_from_student__c
  • September 14, 2017
  • Like
  • 0
I have the below trigger to create Person Account when a new record is created in a custom object Student__c

I would like to seek some expert help on how to modify the trigger to have 'after update' if the record on Student__c is modified, the changes also should be done on the corresponding person account.

The external ID field on Student__c is Student_id__c and also unique field is NRIC__c. I also store the Id from Student__c into Person Account (Student_Id_from_Student_Prospects__pc,NRIC_PC, Salesforce_Id_from_Student_Object__pc

Please help to modify the below trigger to have 'after insert' and 'after update'
-------------------
trigger CreatePersonAccountfromStudent on Student__c (after insert)
{
    List<account> acc=new List<account>();
    Map<Id, String> m = new Map<Id, String>();
    RecordType rt = [select id from RecordType where SobjectType='Account' and Name='Student' Limit 1];
    for(student__c stud:Trigger.New)
    {
      acc.add(new account(
        Autocreated__pc=True,
        Block__pc=Stud.Block__c,
        Bulk_Load__pc=Stud.Bulk_Load__c,
        Current_Acedamic_Year__pc=Stud.Current_Acedamic_Year__c,
        Date_of_Collection__pc=Stud.Date_of_Collection__c,
        Discount_Percentage__pc=Stud.Discount_Percentage__c,
        Discount_Policy__pc=Stud.Discount_Policy__c,
        Discount_Remarks__pc=Stud.Discount_Remarks__c,
        Discount_Type__pc=Stud.Discount_Type__c,
        English__pc=Stud.English__c,
        Event_Name__pc=Stud.Event_Name__c,
        Exclude_Registration__pc=Stud.Exclude_Registration__c,
        Father_Email__pc=Stud.Father_Email__c,
        Father_Name__pc=Stud.Father_Name__c,
        Father_NRIC__pc=Stud.Father_NRIC__c,
        Father_Office_Phone__pc=Stud.Father_Office_Phone__c,
        Father_Primary_Contact__pc=Stud.Father_Primary_Contact__c,
        Father_Remark__pc=Stud.Father_Remark__c,
        Father_Staff__pc=Stud.Father_Staff__c,
        Gender__pc=Stud.Gender__c,
        GEP__pc=Stud.GEP__c,
        Guardian_Email__pc=Stud.Guardian_Email__c,
        Guardian_Mobile__pc=Stud.Guardian_Mobile__c,
        Guardian_Name__pc=Stud.Guardian_Name__c,
        Guardian_NRIC__pc=Stud.Guardian_NRIC__c,
        Guardian_Office_Phone__pc=Stud.Guardian_Office_Phone__c,
        Guardian_Primary_Contact__pc=Stud.Guardian_Primary_Contact__c,
        Guardian_Relationship__pc=Stud.Guardian_Relationship__c,
        Guardian_Remarks__pc=Stud.Guardian_Remark__c,
        Guardian_Staff__pc=Stud.Guardian_Staff__c,
        How_did_you_hear_about_us__pc=Stud.How_did_you_hear_about_us__c,
        Is_Mind_Stretcher_Staff_Mother__pc=Stud.Is_Mind_Stretcher_Staff_Mother__c,
        LastName=Stud.name__c,
        Level__pc=Stud.Level__c,
        Level_Promoted_DateTime__pc=Stud.Level_Promoted_DateTime__c,
        Maths__pc=Stud.Maths__c,
        Mobile_No_Father__pc=Stud.Mobile_No_Father__c,
        Mother_Email__pc=Stud.Mother_Email__c,
        Mother_Name__pc=Stud.Mother_Name__c,
        Mother_No_Mobile__pc=Stud.Mobile_No_Mother__c,
        Mother_NRIC__pc=Stud.Mother_NRIC__c,
        Mother_Office_Phone__pc=Stud.Mother_Office_Phone__c,
        Mother_Primary_Contact__pc=Stud.Mother_Primary_Contact__c,
        Mother_Remark__pc=Stud.Mother_Remark__c,
        Mother_Staff__pc=Stud.Mother_Staff__c,
        MS_Start_Kit_Bag__pc=Stud.MS_Start_Kit_Bag__c,
        Nationality__pc=Stud.Nationality__c,
        NRIC__pc=Stud.NRIC__c,
        NTUC_10_Discount__pc=Stud.NTUC_10_Discount__c,
        NTUC_Card_Expiry__pc=Stud.NTUC_Card_Expiry__c,
        NTUC_Remark__pc=Stud.NTUC_Remark__c,
        Others__pc=Stud.Others__c,
        Others_How_did_you_hear_about_us__pc=Stud.Others_How_did_you_hear_about_us__c,
        Person_Contact__pc=Stud.Person_Contact__c,
        PersonBirthdate=Stud.DOB__c,
        PersonHomePhone=Stud.Home_No__c,
        PersonMailingPostalCode=Stud.Postal_Code__c,
        PersonMailingStreet=Stud.Street_Temp__C,
        Primary_Contact_Number__pc=Stud.Contact_number__c,
        Primary_Email__pc=Stud.Primary_Email__c,
        Primary_Name__pc=Stud.Primary_Name__c,
        Primary_Remark__pc=Stud.Primary_Remark__c,
        Promotion__pc=Stud.Promotion__c,
        Reading_Oceans_Email__pc=Stud.Reading_Oceans_Email__c,
        Reading_Oceans_End_Date__pc=Stud.Reading_Oceans_End_Date__c,
        Reading_Oceans_Start_Date__pc=Stud.Reading_Oceans_Start_Date__c,
        Reading_Oceans_Subscrip__pc=Stud.Reading_Oceans_Subscrip__c,
        recordtypeid=rt.id,
        Registration_Centre__pc=Stud.Registration_Centre__c,
        Related_Centres__pc=Stud.Related_Centres__c,
        Remarks__pc=Stud.Remarks__c,
        RO_Date_Send_User__pc=Stud.RO_Date_Send_User__c,
        RO_Remark__pc=Stud.RO_Remark__c,
        RO_Type__pc=Stud.RO_Type__c,
        Safra_Card_Expiry__pc=Stud.Safra_Card_Expiry__c,
        Safra_Card_Holding__pc=Stud.Safra_Card_Holding__c,
        Safra_Remark__pc=Stud.Safra_Remark__c,
        Salesforce_Id_from_Student_Object__pc=Stud.ID,
        School__pc=Stud.School__c,
        Science__pc=Stud.Science__c,
        Secondary_Stream__pc=Stud.Secondary_Stream__c,
        Start_Date__pc=Stud.Start_Date__c,
        Street__pc=Stud.Street__c,
        Student_Id_from_Student_Prospects__pc=Stud.name,
        Student_Old_Reference_ID__pc=Stud.Student_Old_Reference_ID__c,
        Student_Status__pc=Stud.Student_Status__c,
        Student_Type__pc='Student',
        Tick_to_activate_inter_branch_discount__pc=Stud.Tick_to_activate_inter_branch_discount__c,
        Type_Course_Fee__pc=Stud.Type_Course_Fee__c,
        Unit_Number__pc=Stud.Unit_Number__c
    ));
 }
    insert acc;
}
  • July 24, 2017
  • Like
  • 0
I have the below VF Page with 10 custom buttons,
<apex:page id="TeacherKPI_VF" controller="TeacherKPI_VF_Controller">
  <apex:form >
  <div style="text-align:center;">
      <h1 style="text-decoration: underline;">TEACHER'S KPI</h1><br/><br/>
      <apex:commandButton value="Lesson Observation" action="{!LessonObservation_VF}"/><br/><br/>
      <apex:commandButton value="File Check" action="{!FileCheck_VF}"/><br/><br/>
      <apex:commandButton value="Request for Corrective Action" action="{!RequestforCorrectiveAction_VF}"/><br/><br/>
      <apex:commandButton value="Withdrawal Trend" action="{!WithdrawalTrend_VF}"/><br/><br/>              
      <apex:commandButton value="Cost Recoverability Index" action="{!CostRecoverabilityIndex_VF}"/><br/><br/>
      <apex:commandButton value="Teacher Parent Dialogue Log" action="{!TeacherParentDialogueLog_VF}"/><br/><br/>
      <apex:commandButton value="Training sessions" action="{!TrainingSessions_VF}"/><br/><br/>
      <apex:commandButton value="Parent's Survey" action="{!ParentSurvey_VF}"/><br/><br/>
      <apex:commandButton value="Student's Survey" action="{!StudentSurvey_VF}"/><br/><br/>
      <apex:commandButton value="Leave / MC" action="{!LeaveMC_VF}"/><br/><br/>
      <apex:commandButton value="Back" action="{!Back}"/>      
  </div>
  </apex:form>
</apex:page>

When any of the button is click, need to open another VF PAGEs for example
<apex:commandButton value="Lesson Observation" action="{!LessonObservation_VF}"/><br/><br/> need to open VF Page LessonObservation_VF, I am not sure on how to do this, please help

The Class is not complete yet
public with sharing class TeacherKPI_VF_Controller {

    public PageReference Back() {
        return null;
    }

    public PageReference LeaveMC_VF() {
        return null;
    }

    public PageReference StudentSurvey_VF() {
        return null;
    }

    public PageReference ParentSurvey_VF() {
        return null;
    }

    public PageReference TrainingSessions_VF() {
        return null;
    }

    public PageReference TeacherParentDialogueLog_VF() {
        return null;
    }


    public PageReference CostRecoverabilityIndex_VF() {
        return null;
    }

    public PageReference WithdrawalTrend_VF() {
        return null;
    }

    public PageReference RequestforCorrectiveAction_VF() {
        return null;
    }

    public PageReference FileCheck_VF() {
        return null;
    }

    public PageReference LessonObservation_VF() {
        return null;
    }

}

 
  • July 19, 2017
  • Like
  • 0
Hi

I have attached a screenshot, I need help to create a VF Page same as the attached picture, so that from each button I can call different class to do data entry
User-added image
  • July 19, 2017
  • Like
  • 0
I have a trigger and when running hit the below error. not sure how to fix this, requesting expert help.

Error:Apex trigger updateReliefTeacheronTeacherClassSession caused an unexpected exception, contact your administrator: updateReliefTeacheronTeacherClassSession: execution of AfterUpdate caused by: System.QueryException: Non-selective query against large object type (more than 200000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): Trigger.updateReliefTeacheronTeacherClassSession: line 14, column 1

trigger updateReliefTeacheronTeacherClassSession on Staff_Leave__c (after insert, after update)
    {
        map<string, Staff_Leave__c> ObjMap = new map<string, Staff_Leave__c>();
        DateTime myDateTime;
        String dayOfWeek;
        
  
        for(Staff_Leave__c obj: Trigger.new)
        {   List<Class__c> classList = [SELECT Id,Day__c from Class__c where id =: obj.Active_Class__c];
            
            if (obj.Relief_Teacher__c != Null)
            {   myDateTime = (DateTime)obj.date_of_leave__c;
                dayOfWeek = myDateTime.format('E');
                
                for(Class__c classRec:classList)
                {
                    if(dayOfWeek != classRec.day__c)
                    {
                       obj.addError('Please check leave dates.'); 
                    }
                    else
                    {
                        ObjMap.put(obj.Teacher__c, obj);
                    }
                }
                System.debug('-----Teacher is = '+ obj.Teacher__c + ' ------');
            }
        }
         
        List<Teacher_Class_Session__c> T = [SELECT Id,Teacher__c, Staff_Leave__c ,Assigned_Teacher__c,Relief_Type__c , Class__c,Class__r.teacher__c, Session_Date__c, Attendant_Status__c FROM Teacher_Class_Session__c WHERE Class__r.teacher__c IN :ObjMap.KeySet()];
        List<Teacher_Class_Session__c> TUpdateList = new List<Teacher_Class_Session__c>();
         
        for(Teacher_Class_Session__c c: T)
        {   System.debug('----------- Iterating through all class sessions-----');
            
            Staff_Leave__c obj = ObjMap.get(c.class__r.teacher__c);
            System.debug('Class session id = '+ c.id);
            System.debug('c.teacher= ' + c.class__r.teacher__c);
            System.debug('obj teacher= ' +obj.teacher__c);
            System.debug('c.class= ' + c.class__c + ' ' + 'obj class= ' +obj.Active_Class__c );
            System.debug('c.date= ' + c.session_date__c + ' ' + 'obj class= ' +obj.date_of_leave__c);
                        
            if(obj.Teacher__c == c.Class__r.teacher__c && obj.Active_Class__c == c.Class__c && c.session_date__c == obj.date_of_leave__c)
            { System.debug('Match found');
             c.Teacher__c = obj.Relief_Teacher__c;
             c.Relief_Type__c = obj.Leave_Type__c;
             c.Attendant_Status__c= 'Relief';
             c.Staff_Leave__c = obj.id;
             tUpdateList.add(c);
             }
         
           
        }
     
        if(tUpdateList.size() > 0)
        {
            update tUpdateList;
        }
        
    }
  • July 18, 2017
  • Like
  • 0
I have a field called 'Expiry_Date__C.  Can anybody help me to write a formula to populate the last date of this to a date field using formula
  • June 29, 2017
  • Like
  • 0
Hi 

I have an object with the following fields.  I need help to write an html / VF email tempalte to display this details in columns 1, 2, 3, 4, 5,6,7,8,9

Object Name: Staff_Leave__c
---------------------------
Column 1. Centre__c
Column 2. Date_of_Leave__c
Column 3. Date_of_approval__c
Column 4. Day__c    
Column 5. Leave_Type__c    
Column 6. Teacher__c    
Column 7. Teacher_Phone_Number__c    
Column 8. Relief_Teacher__c    
Column 9. Relief_Teacher_Phone_Number__c

Please help
 
  • June 12, 2017
  • Like
  • 0
Hi 

I would like to change the default fields displayed in the list of campaign members on the Add Campaign members screen as per attached.  Is there a way to permanantly change those fields to my custom fields Attached the screenshot
  • May 09, 2017
  • Like
  • 0
We have a custom object called Staff__c and Staff_Leave__c.  I need to sent an email to a record in Staff__c when his leave record in Staff_Leave__c is approved by changing the Leave_Status__c to 'Approvved'.  Is there a way to do this please advice
  • April 27, 2017
  • Like
  • 0
I have a Picklist field on Case called Type with values 'Teacher Related, Policy Feedback, Curriculum Feedback' I have another field called Teacher_Name__c.  I need some help to write a validation rule so that if the user select the either 'Policy Feedback' or 'Curriculum Feedback' The teacher_name__c field should be made non editable and when the user choose 'Teacher Related' the Teacher_Name__c should be allowed to choose the teacher name.
  • April 18, 2017
  • Like
  • 0
Hi 

We are awarding points for the payments made.  I have a issued date (Points_Issue_Date__c) and Expiry date (Points_Expiry_Date__c). When a record is created in this object (Loyalty_Points__c) 
If the issued date is between 1/12/2016 - 30/11/2017 the expiry date is set as 30/11/2018
If the issued date is between 1/12/2017 - 30/11/2018 the expiry date is set as 30/11/2019
and goes on. In shor I need to set the expiry date is set as 2 years from issue date, but if the issue date goes forward, the expiry date will not change.

Any body can help
  • March 28, 2017
  • Like
  • 0
Hi 

Can any expert help me to create a formula to calculate the # of weeks in the current month ro create a formula field

Thanks in adv
  • January 10, 2017
  • Like
  • 0
Field (1) How_did_you_hear_about_us__c has the following values and it is a multi picklist field

Brochure
Bus Advert
EDM [Email]
Events
Facebook
Instagram
Others
Parent Forum
Search Engine
Twitter
Website
Word of Mouth

Field 2 Others_How_did_you_hear_about_us__c is a text field (50 characters)

I am having trouble in writing a validation rule, if 'Others' is selected from field 1, field 2 need to be manadatory.  and if rest of the values are choosen, the Field 2 is not mandatory.  I have a situation if the user select 'Others' and some other options, the record is not able to save, I need some help on this, for example if I choose (Instagram, Others, Parent Forum), I cannot save the record

 
  • November 07, 2016
  • Like
  • 0