• OleGoRules
  • NEWBIE
  • 25 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Hey guys, I have created a formula field to reflect the activity status with an LED. The formula works, but I would like LED to reset to red at the end of every year. Any help would be highly appreciated.

Last Activity is a custom field that captures the SF modified date on Booked__c, Events__c and In_Person__c are all custom number fields.  

Data TypeFormula  
IF(Last_Activity__c = null, IMAGE('/img/samples/light_red.gif','Red'),  IF( Booked__c >= 1, IMAGE('/img/samples/light_green.gif','Green'),  IF(  OR(In_Person__c >=1, Events_Attended__c >=1),  IMAGE('/img/samples/light_yellow.gif','Yellow'),  IF(  OR((In_Person__c >=1), (Events_Attended__c >=1), AND(Booked__c >= 1)),  IMAGE('/img/samples/light_green.gif','Green'),  IMAGE('/img/samples/light_red.gif','Red')  )  )  )  )
Hey guys, I have a bunch of custom fields (In person drop ins, appointsments booked, meetings attended etc) at the contact level. I need the last activity date field to reflect any activities related to these fields and nor if a task or events are associated to the contact. I created a custom 'Last Activity' Date field and created a workflow rule with the follow. If captures the date when any one of the custom fields are modified however, it doesnt capture the date when a task or event is created. Is there something wrong with my formula?

OR( 
ISCHANGED(LastActivityDate), 
ISCHANGED(In_Person__c), 
ISCHANGED(Appointments_Booked__c), 
ISCHANGED(Meetings_Attended__c) 
)
Hey guys need some help with my logic below. So essentially, a company has B2C and B2B Accounts & Contacts. To avoid person accounts for B2C contacts, i have written a trigger below to automatically create an account with recordtype 'Aministrative'. The trigger works fine, but it creates an account for all types of contacts - I need to create an 'Aministrative' Account only for Contact recordtype 'Customer'. Any other type of contacts (B2B), must lookup its Account beloew save or should create a new Account first, if the Account does not exist. 

Also, the company does a yearly load of all 'Customer' contacts - is there any governance issues with mass triggers? there could potentially 10k+ Contacts in the data load that would require auto creation of Accounts.

trigger CustomerAccountCreation on Contact (after insert) {

  RecordType arec = [SELECT ID FROM RecordType WHERE sObjectType = 'Account' AND DeveloperName = 'Administrative'];

    Map<Id, Account> aMap = new Map<Id, Account>();

    for (Contact con : trigger.new){
        if(con.AccountID == null){
            Account acc = new Account();
                acc.name = con.FirstName + ' ' + con.LastName + ' ' + 'Administrative';
                acc.RecordTypeId = arec.Id;
            aMap.put(con.Id, acc);
        }
    }

    if (!aMap.isEmpty()) {
        insert aMap.values();

        List<Contact> cList = new List<Contact>();

        for (Id cId : aMap.keySet()) {
            Contact con = new Contact();
                con.Id = cId;
                con.AccountId = aMap.get(cId).Id;
            cList.add(con);
        }

        update cList;

    }

}
Hey guys, I need some help writing a formula for a combination of checkbox and number fields. Any help would be much appreciated. The logic is to have an engagement scoring model on a scale of (1-5 stars).  The engagement score is a progressive measure of an employer's performance over the fiscal year.
If the contact is a top employer (checkbox) - 1 star
If a top performer (checkbox) - 1 star
No. of in person consultations (number field) -  1/2 star for each consultation, max up to 5 consultations a total of 2.5 stars accumulated
No. of appointments booked over the phone (number field) - 1 star for each booking, max up to 3 stars accumulated
No. of seminars booked  (number field) - 1/2 star for every 3 seminars booked
Thanks.
Hey guys need some help with my logic below. So essentially, a company has B2C and B2B Accounts & Contacts. To avoid person accounts for B2C contacts, i have written a trigger below to automatically create an account with recordtype 'Aministrative'. The trigger works fine, but it creates an account for all types of contacts - I need to create an 'Aministrative' Account only for Contact recordtype 'Customer'. Any other type of contacts (B2B), must lookup its Account beloew save or should create a new Account first, if the Account does not exist. 

Also, the company does a yearly load of all 'Customer' contacts - is there any governance issues with mass triggers? there could potentially 10k+ Contacts in the data load that would require auto creation of Accounts.

trigger CustomerAccountCreation on Contact (after insert) {

  RecordType arec = [SELECT ID FROM RecordType WHERE sObjectType = 'Account' AND DeveloperName = 'Administrative'];

    Map<Id, Account> aMap = new Map<Id, Account>();

    for (Contact con : trigger.new){
        if(con.AccountID == null){
            Account acc = new Account();
                acc.name = con.FirstName + ' ' + con.LastName + ' ' + 'Administrative';
                acc.RecordTypeId = arec.Id;
            aMap.put(con.Id, acc);
        }
    }

    if (!aMap.isEmpty()) {
        insert aMap.values();

        List<Contact> cList = new List<Contact>();

        for (Id cId : aMap.keySet()) {
            Contact con = new Contact();
                con.Id = cId;
                con.AccountId = aMap.get(cId).Id;
            cList.add(con);
        }

        update cList;

    }

}
Hey guys, I need some help writing a formula for a combination of checkbox and number fields. Any help would be much appreciated. The logic is to have an engagement scoring model on a scale of (1-5 stars).  The engagement score is a progressive measure of an employer's performance over the fiscal year.
If the contact is a top employer (checkbox) - 1 star
If a top performer (checkbox) - 1 star
No. of in person consultations (number field) -  1/2 star for each consultation, max up to 5 consultations a total of 2.5 stars accumulated
No. of appointments booked over the phone (number field) - 1 star for each booking, max up to 3 stars accumulated
No. of seminars booked  (number field) - 1/2 star for every 3 seminars booked
Thanks.