• Aparna Hegde 8
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
I Have a process builder that triggers on event object, and sends out an email alert. Recently we have implemented roles and hierarchy in salesforce and the process builder is throwing an error - invalid cross reference ID.

Could it be because the logged in user does not have access to the event record?

If yes, is there a way i could fix without changing roles?
I want the ability to filter report on SObject with Activity and filter for latest activity. There is an idea posted 11 yrs ago for this functionality and unfortuantely its not available. I know creating a custom field on activity helps, looking at coding to achieve this. Any help on documentation around this?
 
public without sharing class LawyerAddressAllocationSelector {

    public Map< Lawyer_Address_Allocation__c,String> selectByClosest(List<Id> lawyerIds, Double latitude, Double longitude) {
         Map< Lawyer_Address_Allocation__c,String>  DistWithAddr = new Map< Lawyer_Address_Allocation__c,String>();  
    for (Lawyer_Address_Allocation__c record:[Select Id,Start_Time__c, End_Time__c, Lawyer_Name__c, Lawyer_Name__r.Name,
                Office_Address__c, Office_Address__r.Geo_Coordinate__c,DISTANCE(Office_Address__r.Geo_Coordinate__c, GEOLOCATION(:latitude, :longitude), 'km') Dist
            From Lawyer_Address_Allocation__c
            Where (
                (Start_Time__c = null And End_Time__c = null)
                Or (Start_Time__c !=null And End_Time__c != null And End_Time__c >= TODAY)
            ) And Office_Address__c!=null AND Lawyer_Name__c in: lawyerIds
            Order by DISTANCE(Office_Address__r.Geo_Coordinate__c, GEOLOCATION(:latitude, :longitude), 'km'), Primary__c
            Limit 10000
                                             ]){
                                                 DistWithAddr.put(record,(String)record.get('Dist'));
    system.debug('Return'+ DistWithAddr) ;                                        }
    return DistWithAddr;
    }


List<Id> Lid=new List<Id>();
Lid.add('a0iO000000AUAESIA5');
Lid.add('a0iO000000AeLcAIAV');
LawyerAddressAllocationSelector.selectByClosest(Lid,-37.908700,144.741720);

Line: 4, Column: 33
Method does not exist or incorrect signature: void selectByClosest(List<Id>, Decimal, Decimal) from the type LawyerAddressAllocationSelector
I want the ability to filter report on SObject with Activity and filter for latest activity. There is an idea posted 11 yrs ago for this functionality and unfortuantely its not available. I know creating a custom field on activity helps, looking at coding to achieve this. Any help on documentation around this?