• Aaliya Yusufzai
  • NEWBIE
  • 75 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 13
    Replies
I have a "Welcome" custom object and we would like to count the number of activities on this object.  Their is no way of creating a roll up count, so wondering on how to do this (without using Roll up helper).
I'm trying to update an account field from the opportunity object, but would like to create a formula field as i'm trying to select certain criteria's.
If Opportunity.Type equals New, then upate the Account Field with the Total Amount from the Opportunity object.
I'm trying to create a field if License Type (which is a formula field) equals New, then we should bring in a value from a Currency field "Total Amount"

Not sure how to do this.
I'm looking at creating a validation rule to be mandatory only if the record was created today. Any help on creating this would be great.
I am looking at creating a formula currency field to populate the field "List Price" only if a value from a picklist field is selected:
IF(CASE(X3rd_Party_Or_TB__c, "3rdParty"), "ListPrice__c")

The formula is not working. 
Hi,
I'm trying to create a formula field.  
If a picklist value is "Monthly", then take the currency field of "Total" and divide that by 12 to show the value
​If a picklist value is "Annual", then take the currency field of "Total" and divide that by a number field 1 to show the value
f a picklist value is "SemiAnnual", then take the currency field of "Total" and divide that by a number field 2 to show the value

I'm not sure how to do this. 
I'm trying to create a Formula Checkbox field and would like to be false if another Field that is a Picklist has a value that has been selected.
Example:
Picklist Field is Stage
IF Stage value is Closed Won, the Checkbox Formula field is False.
IF Stage Value is Signed, the Checkbox Formula field is False.

If someone can help.  Not sure how to create a checkbox formula field.
Hi,
I'm trying to create a formula field to round up to either 1.00 or 1.50 or 2.00 or 3.00.  There will not ever be anything over 
The formula field is as follows: ROUND(X10Min_ofHours__c + X15Min_ofHours__c + X20Min_ofHours__c + X45Min_ofHours__c,1)

These are driven by products selected and rounds into minutes.  Example of roll-up: if .80, then it should display 1.00, and if 1.10, than it should show up as 1.50 and if it shows 1.60, it should show as 2.00 and if it shows 2.10 or anything over, it will all round up/down to 3.00  So it's a roundup.  How can I configure this formula field.
I'm not sure how to create a formula check box field on the Lead object to say if Profile is ________ & profile is __________, then True.  
So, I need the check box to be checked when a particular Profile creates the lead. 
I need help to somehow break this trigger as It is not allowing me to change ownership of a lead due to activities assigned to users. I'm not a developer and someone had created this Apex Trigger below.  I tried to inactivate this by creating a change set and deploying into production, however, it keeps giving me the following error message when I am deploying: "System.AssertException: Assertion Failed: Event: The Owner Id is not updating: Expected: 005W00000039nhYIAQ, Actual: 005U0000006SDUqRBO 
Stack Trace: Class.LeadOwnerChangeReassignEvent_test.test: line 32, column 1"


The Apex Trigger is as follows:
trigger LeadOwnerChangeReassignEvent on Lead (before insert, before update, after update) {
    //if(Trigger.IsInsert){
    if(Trigger.IsBefore){   
        List<User> u = [Select id, name, username,email from USER where name like '%Bastian Spekker%'];
        for (Lead l : trigger.new){
            String add = (l.City!=null?l.City.toLowercase():'')+'-'+(l.Street!=null?l.Street.toLowercase():'')+'-'+(l.State!=null?l.State.toLowercase():'')+'-'+(l.Country!=null?l.Country.toLowercase():'');
            if(add.contains('Australia') && u!=null && u.size()>0){
                l.OwnerId = u[0].id;    //Assuming Bastian is queried above
                System.debug('***Updating owner to '+l.OwnerId);
               
            }
        }
    }
    if(Trigger.IsUpdate && Trigger.IsAfter){
        List<Event> events;
        List<Task> tasks;
        List<Id> leadIds = new List<Id>();
       
        for (Lead l : trigger.new)
            if(trigger.newMap.get(l.Id).OwnerId != trigger.oldMap.get(l.Id).OwnerId)
                leadIds.add(l.id);
       
        events = [SELECT Id, WhoId, ScheduleOnce__Event_status__c, EndDateTime FROM Event WHERE WhoId in :leadIds];
       
        for (Lead l : trigger.new) {
            for (Event e : events) {
               if (l.Id == e.WhoId && ( e.EndDateTime < date.Today() ||
                   ( e.ScheduleOnce__Event_status__c != 'Completed'
                     && e.ScheduleOnce__Event_status__c != 'Canceled (rescheduled by Customer)'
                     && e.ScheduleOnce__Event_status__c != 'Canceled by Customer'
               && e.ScheduleOnce__Event_status__c != 'Canceled (reschedule requested by Owner)'
                     && e.ScheduleOnce__Event_status__c != 'Canceled by Owner'
                     && e.ScheduleOnce__Event_status__c != 'No-Show'
                  ))) e.OwnerId = l.OwnerId;
            }
        }
        if (events.size() != 0) update events;
 
      tasks = [SELECT Id, WhoId, isClosed FROM Task WHERE WhoId in :leadIds];
       
        for (lead l : trigger.new) {
            for (Task t : tasks) {
                if (l.id == t.WhoId && !t.isClosed) {
                    t.OwnerId = l.OwnerId;               
                }
            }
        }
        if (tasks.size() != 0) update tasks;
    }
}
trigger LeadOwnerChangeReassignEvent on Lead (before insert, before update, after update) {
    //if(Trigger.IsInsert){
    if(Trigger.IsBefore){   
        List<User> u = [Select id, name, username,email from USER where name like '%Bastian Spekker%'];
        for (Lead l : trigger.new){
            String add = (l.City!=null?l.City.toLowercase():'')+'-'+(l.Street!=null?l.Street.toLowercase():'')+'-'+(l.State!=null?l.State.toLowercase():'')+'-'+(l.Country!=null?l.Country.toLowercase():'');
            if(add.contains('Mexico') && u!=null && u.size()>0){
                l.OwnerId = u[0].id;    //Assuming Bastian is queried above
                System.debug('***Updating owner to '+l.OwnerId);
               
            }
        }
    }
    if(Trigger.IsUpdate && Trigger.IsAfter){
        List<Event> events;
        List<Task> tasks;
        List<Id> leadIds = new List<Id>();
       
        for (Lead l : trigger.new)
            if(trigger.newMap.get(l.Id).OwnerId != trigger.oldMap.get(l.Id).OwnerId)
                leadIds.add(l.id);
       
        events = [SELECT Id, WhoId, ScheduleOnce__Event_status__c, EndDateTime FROM Event WHERE WhoId in :leadIds];
       
        for (Lead l : trigger.new) {
            for (Event e : events) {
               if (l.Id == e.WhoId && ( e.EndDateTime < date.Today() ||
                   ( e.ScheduleOnce__Event_status__c != 'Completed'
                     && e.ScheduleOnce__Event_status__c != 'Canceled (rescheduled by Customer)'
                     && e.ScheduleOnce__Event_status__c != 'Canceled by Customer'
               && e.ScheduleOnce__Event_status__c != 'Canceled (reschedule requested by Owner)'
                     && e.ScheduleOnce__Event_status__c != 'Canceled by Owner'
                     && e.ScheduleOnce__Event_status__c != 'No-Show'
                  ))) e.OwnerId = l.OwnerId;
            }
        }
        if (events.size() != 0) update events;
 
      tasks = [SELECT Id, WhoId, isClosed FROM Task WHERE WhoId in :leadIds];
       
        for (lead l : trigger.new) {
            for (Task t : tasks) {
                if (l.id == t.WhoId && !t.isClosed) {
                    t.OwnerId = l.OwnerId;               
                }
            }
        }
        if (tasks.size() != 0) update tasks;
    }
}
 
Hello,  I am trying to create a validation rule, so that an Opportunity cannot change to a certain Stage Value, once the Opportunity Created date is greater than 30 days.
The Stage Value  is "No Opportunity"

Here is the validation that I have created and It is not working:
AND(ISPICKVAL(StageName, "No Opportunity"), 
(DATEVALUE(CreatedDate) > TODAY() + 30))

If someone can help please.
I am looking at creating a formula currency field to populate the field "List Price" only if a value from a picklist field is selected:
IF(CASE(X3rd_Party_Or_TB__c, "3rdParty"), "ListPrice__c")

The formula is not working. 
Hi,
I'm trying to create a formula field.  
If a picklist value is "Monthly", then take the currency field of "Total" and divide that by 12 to show the value
​If a picklist value is "Annual", then take the currency field of "Total" and divide that by a number field 1 to show the value
f a picklist value is "SemiAnnual", then take the currency field of "Total" and divide that by a number field 2 to show the value

I'm not sure how to do this. 
I'm trying to create a Formula Checkbox field and would like to be false if another Field that is a Picklist has a value that has been selected.
Example:
Picklist Field is Stage
IF Stage value is Closed Won, the Checkbox Formula field is False.
IF Stage Value is Signed, the Checkbox Formula field is False.

If someone can help.  Not sure how to create a checkbox formula field.
Hi,
I'm trying to create a formula field to round up to either 1.00 or 1.50 or 2.00 or 3.00.  There will not ever be anything over 
The formula field is as follows: ROUND(X10Min_ofHours__c + X15Min_ofHours__c + X20Min_ofHours__c + X45Min_ofHours__c,1)

These are driven by products selected and rounds into minutes.  Example of roll-up: if .80, then it should display 1.00, and if 1.10, than it should show up as 1.50 and if it shows 1.60, it should show as 2.00 and if it shows 2.10 or anything over, it will all round up/down to 3.00  So it's a roundup.  How can I configure this formula field.
I'm not sure how to create a formula check box field on the Lead object to say if Profile is ________ & profile is __________, then True.  
So, I need the check box to be checked when a particular Profile creates the lead. 
I need help to somehow break this trigger as It is not allowing me to change ownership of a lead due to activities assigned to users. I'm not a developer and someone had created this Apex Trigger below.  I tried to inactivate this by creating a change set and deploying into production, however, it keeps giving me the following error message when I am deploying: "System.AssertException: Assertion Failed: Event: The Owner Id is not updating: Expected: 005W00000039nhYIAQ, Actual: 005U0000006SDUqRBO 
Stack Trace: Class.LeadOwnerChangeReassignEvent_test.test: line 32, column 1"


The Apex Trigger is as follows:
trigger LeadOwnerChangeReassignEvent on Lead (before insert, before update, after update) {
    //if(Trigger.IsInsert){
    if(Trigger.IsBefore){   
        List<User> u = [Select id, name, username,email from USER where name like '%Bastian Spekker%'];
        for (Lead l : trigger.new){
            String add = (l.City!=null?l.City.toLowercase():'')+'-'+(l.Street!=null?l.Street.toLowercase():'')+'-'+(l.State!=null?l.State.toLowercase():'')+'-'+(l.Country!=null?l.Country.toLowercase():'');
            if(add.contains('Australia') && u!=null && u.size()>0){
                l.OwnerId = u[0].id;    //Assuming Bastian is queried above
                System.debug('***Updating owner to '+l.OwnerId);
               
            }
        }
    }
    if(Trigger.IsUpdate && Trigger.IsAfter){
        List<Event> events;
        List<Task> tasks;
        List<Id> leadIds = new List<Id>();
       
        for (Lead l : trigger.new)
            if(trigger.newMap.get(l.Id).OwnerId != trigger.oldMap.get(l.Id).OwnerId)
                leadIds.add(l.id);
       
        events = [SELECT Id, WhoId, ScheduleOnce__Event_status__c, EndDateTime FROM Event WHERE WhoId in :leadIds];
       
        for (Lead l : trigger.new) {
            for (Event e : events) {
               if (l.Id == e.WhoId && ( e.EndDateTime < date.Today() ||
                   ( e.ScheduleOnce__Event_status__c != 'Completed'
                     && e.ScheduleOnce__Event_status__c != 'Canceled (rescheduled by Customer)'
                     && e.ScheduleOnce__Event_status__c != 'Canceled by Customer'
               && e.ScheduleOnce__Event_status__c != 'Canceled (reschedule requested by Owner)'
                     && e.ScheduleOnce__Event_status__c != 'Canceled by Owner'
                     && e.ScheduleOnce__Event_status__c != 'No-Show'
                  ))) e.OwnerId = l.OwnerId;
            }
        }
        if (events.size() != 0) update events;
 
      tasks = [SELECT Id, WhoId, isClosed FROM Task WHERE WhoId in :leadIds];
       
        for (lead l : trigger.new) {
            for (Task t : tasks) {
                if (l.id == t.WhoId && !t.isClosed) {
                    t.OwnerId = l.OwnerId;               
                }
            }
        }
        if (tasks.size() != 0) update tasks;
    }
}
trigger LeadOwnerChangeReassignEvent on Lead (before insert, before update, after update) {
    //if(Trigger.IsInsert){
    if(Trigger.IsBefore){   
        List<User> u = [Select id, name, username,email from USER where name like '%Bastian Spekker%'];
        for (Lead l : trigger.new){
            String add = (l.City!=null?l.City.toLowercase():'')+'-'+(l.Street!=null?l.Street.toLowercase():'')+'-'+(l.State!=null?l.State.toLowercase():'')+'-'+(l.Country!=null?l.Country.toLowercase():'');
            if(add.contains('Mexico') && u!=null && u.size()>0){
                l.OwnerId = u[0].id;    //Assuming Bastian is queried above
                System.debug('***Updating owner to '+l.OwnerId);
               
            }
        }
    }
    if(Trigger.IsUpdate && Trigger.IsAfter){
        List<Event> events;
        List<Task> tasks;
        List<Id> leadIds = new List<Id>();
       
        for (Lead l : trigger.new)
            if(trigger.newMap.get(l.Id).OwnerId != trigger.oldMap.get(l.Id).OwnerId)
                leadIds.add(l.id);
       
        events = [SELECT Id, WhoId, ScheduleOnce__Event_status__c, EndDateTime FROM Event WHERE WhoId in :leadIds];
       
        for (Lead l : trigger.new) {
            for (Event e : events) {
               if (l.Id == e.WhoId && ( e.EndDateTime < date.Today() ||
                   ( e.ScheduleOnce__Event_status__c != 'Completed'
                     && e.ScheduleOnce__Event_status__c != 'Canceled (rescheduled by Customer)'
                     && e.ScheduleOnce__Event_status__c != 'Canceled by Customer'
               && e.ScheduleOnce__Event_status__c != 'Canceled (reschedule requested by Owner)'
                     && e.ScheduleOnce__Event_status__c != 'Canceled by Owner'
                     && e.ScheduleOnce__Event_status__c != 'No-Show'
                  ))) e.OwnerId = l.OwnerId;
            }
        }
        if (events.size() != 0) update events;
 
      tasks = [SELECT Id, WhoId, isClosed FROM Task WHERE WhoId in :leadIds];
       
        for (lead l : trigger.new) {
            for (Task t : tasks) {
                if (l.id == t.WhoId && !t.isClosed) {
                    t.OwnerId = l.OwnerId;               
                }
            }
        }
        if (tasks.size() != 0) update tasks;
    }
}
 
Hello,  I am trying to create a validation rule, so that an Opportunity cannot change to a certain Stage Value, once the Opportunity Created date is greater than 30 days.
The Stage Value  is "No Opportunity"

Here is the validation that I have created and It is not working:
AND(ISPICKVAL(StageName, "No Opportunity"), 
(DATEVALUE(CreatedDate) > TODAY() + 30))

If someone can help please.