• Andrew G
  • PRO
  • 4484 Points
  • Member since 2014
  • Salesforce Learner

  • Chatter
    Feed
  • 144
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 15
    Questions
  • 778
    Replies
Can we call a trigger from Batch class and batch class from trigger? if yes then what are the limitations.
On Account, How to fetch no. of open Opportunity
I tried using SalesForce Optimizer but apparently, it lies to me. It says that we don't have anything using API 20 or below, but I was sent an email from SalesForce that says " Our records show that you have apps using API version 20 or below". Since SalesForce is retiring API 7 - 20.  So how can I find where API 20 or below is being used so I can update it? 
I'm trying to figure out what the formula would be to require one picklist be selected if a certain item in another multi select picklist field is chosen.

I.E.  If Project type which is a multi select picklist contain PG then the PG type picklist field should be required.

Thanks,

Hi all ,

I have one requirement i need to bypass validation rule for one profile using apex class code not trigger how can i do that .
can any one help me on this 

 

I'm, just getting 63% code coverage..not able to incerase c..can any one help me
User-added image
Test class:
@isTest
public class TestOpportunityContactRoleHandler {
    @isTest static void TestBeforeInsertMethod(){
        
        Contact ConRec= new Contact();
        ConRec.FirstName = 'Test';
        ConRec.LastName   = 'Test';
        insert ConRec;
        
        Opportunity opps = new opportunity();
        opps.Name='test';
        opps.StageName='Processing';
        insert opps;
        
        OpportunityContactRole oppRole = new OpportunityContactRole();
        oppRole.Role='ROLE1';
        oppRole.ContactId = ConRec.Id;
        oppRole.OpportunityId = opps.Id;
        insert oppRole;
    }

 

please help with Process builder

 

AND(
ISCHANGED([Lead].Lead_Stage__c),
TEXT([Lead].Lead_Stage__c ) = "reengaged", 
OR(
TEXT([Lead].Source_Subtype__c) = "CPL", 
TEXT([Lead].scorecarr__c)  = "CPL" 
)
)

I have to 2 object having master-detail relationship. 
I want to update a Status picklist field in Parent object if any update is happening on either of the object (Parent or child).
What will be the best approach?

 
We need to update a checkbox field to true on the Service Resource object if the logeed in user is the manager or manager.manager of the service Resource user record. Please suggest.
I am working with events and cases but am having trouble on the concepts of joining two queries.  I need to query all events that:
  • completed yesterday
  • are related to a case (WhatId starts with 500)
  • are of event Type = 'Example'
Each of these are related to a case by definition of the original query, I now need to go through each of the cases and determine what the caseType__c is to determine the next_due_date__c which is a custom date field on the case which should calculate as:
  • Event Date + (If caseType__c = "Example" + 14, 60)

I am having a hard time figuring out how I work with values from two seperate arrays to come up with a calculation.  I was trying to use MAPs but I wasn't quite able to get it to work.

Can someone explain the approach?  Code examples would be great but I am more interested in the approach of how to do this...  So here is an example:

My SOQL Query to build the map between event and case
Map<WhatId, Event> eventCaseMap = new Map<WhatId, Event>([Select Id, WhatId, ActivityDate, Ended_Yesterday__c  From Event WHERE WhatId LIKE '500%' AND Type='Example' AND Ended_Yesterday__c = TRUE]);
Now that I have the map, I need to iterate through this to determine the caseType__c value to calculate the days until due, and then add that to the event ActivityDate so that I can update the case next_due_date__c.

If all the values existed on the same object I can get it to work, but trying to make a calculation off of two of them is where my problem is.  Thanks in advance for any help/direction.
 
Trigger is :
if(Trigger.isInsert){
                CompetitorRecordHandler.CreateRelatedCompetitor(Trigger.new);
            }

Handler class is below:
public static void CreateRelatedCompetitor(List<OpportunityLineItem> newList){
        
        List<Opportunity_Competitor__c> ocList = new List<Opportunity_Competitor__c>();
        
        for(OpportunityLineItem oli : newList){
            Opportunity_Competitor__c OppComp= new Opportunity_Competitor__c();
            
            OppComp.Forecast_Date__c=String.ValueOf(oli.ServiceDate);
            OppComp.Opportunity_Product__c=oli.Id;
            OppComp.Opportunity__c=oli.OpportunityId;
            OppComp.Product__c=oli.Product_Name__c;
            
            ocList.add(OppComp);
        }
        if(!ocList.isEmpty()){
            ocList.sort();
            insert ocList;
        }

I want to Sort my "ocList" on "Forecast_Date__c" basis. Can anyone help me?
Hi Team,

I have an object called Leave Tracker, where users enter the leave date, reason, and number of hours, user can create more than one record in a day with different hours, ex: 1 entry with 2 hours and another entry with 4 hours. but my request is that we should not allow a user to create/update a leave tracker record if the leave hours are more than 8 in a single day per user?

any help is appreciated.

Thanks,
Madhu