• Nithyanandha Nimmala
  • NEWBIE
  • 50 Points
  • Member since 2023

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies
Hello there, I have list of case on which I'm getting my case query result, now based on condition that - OldValue not null condition I want to get those records into new List.
Basically my aim is to filter out those record which has OldValue, newValue (which is coming from Histories field tracking )
 
public static void SessionHistory(){
        try {

            Map<id,list<case>> UserEvent = new Map<id,list<case>>();
            List<case> tempCaseList = null;
            List<case> newEvents1 = new List<case>();

           List<case> newEvents = [SELECT OwnerId,(SELECT OldValue, id, NewValue, CreatedById, CreatedBy.Name, caseId,  case.Ownerid, case.DOS__c FROM Histories where field='status'), Account.Name, Patient_Customer__r.dob__c, CaseNumber,Status,Appointment_Start_Time__c,Appointment_End_Time__c, 
            DOS__c,FacilitiesV3__c,Place_of_Service__c,Practice_Procedure_Code__c,Practice_Procedure_Code__r.Type_of_Service__c,
            Insurance__c,Duration__c, Actual_Duration__c, Unit__c, Actual_Unit__c, Practice_Procedure_Code__r.name, Billed_Amount__c,
            Id,Authorizations__c,Facility_Type__c, Patient_Customer__c, PA_NO_PA__c,Provider__c, Client_Insurance__c,Authorization_Number__c,
            Client_Name__c, Provider_Name__c, Location_Name__c,Insurance_Name__c, Sup_Provider__r.Name FROM Case WHERE Recordtype.Name ='Session'
             ORDER BY OwnerId limit 1800];


             if(newEvents.contains(OldValue)){
               newEvents1.addAll(newEvents);
             }

             system.debug('new history'+ newEvents1);
I tried with listname.contains('OldValue') but it's not working. Please if someone can suggest right approach. It will be very helpful.
 
Hi Community,
Do we have any limits to number of conditions that can be added to a criteria based sharing rule

I came across an error in which I got in a record triggered flow Too many SOQL Queries). It is a. In which a "get record" element which queries contacts by comparing the ids present in another list and having couple of other conditions which checks whether some fields should not be null. The flow element is not present in any loops. can you please tell me in which other direction i can look to solve this issue
I am doing this for so many objects , but i have observed that three objects in my org is not having the option "List View Button Layout" itself. Rest of the objects are having this option. All are custom objects btw Can anyone tell me what might be the reason for this. PS: I am in lightning environment only.

Create a batch class to update contact field. If contact  contact has no Events/Calls in the last 13 months then update contact pick list value as Prospect. when the Activity Type is not equal to Email, Form Submitted, Marketing email sent, Marketing email opened,  sales content viewed, task created.

Can you please provide the class to update the contact field ?

Create two Objects say Teacher(Parent) and Student(Child) having similar fields. On creating record of Teacher, associated student record should be created and vice versa. Additionally, updates should also be in sync i.e. updating the parent should reflect in the child and vice versa.
I want to do this with the help of salesforce flow how to do that?

Thanks
Hello there, I have list of case on which I'm getting my case query result, now based on condition that - OldValue not null condition I want to get those records into new List.
Basically my aim is to filter out those record which has OldValue, newValue (which is coming from Histories field tracking )
 
public static void SessionHistory(){
        try {

            Map<id,list<case>> UserEvent = new Map<id,list<case>>();
            List<case> tempCaseList = null;
            List<case> newEvents1 = new List<case>();

           List<case> newEvents = [SELECT OwnerId,(SELECT OldValue, id, NewValue, CreatedById, CreatedBy.Name, caseId,  case.Ownerid, case.DOS__c FROM Histories where field='status'), Account.Name, Patient_Customer__r.dob__c, CaseNumber,Status,Appointment_Start_Time__c,Appointment_End_Time__c, 
            DOS__c,FacilitiesV3__c,Place_of_Service__c,Practice_Procedure_Code__c,Practice_Procedure_Code__r.Type_of_Service__c,
            Insurance__c,Duration__c, Actual_Duration__c, Unit__c, Actual_Unit__c, Practice_Procedure_Code__r.name, Billed_Amount__c,
            Id,Authorizations__c,Facility_Type__c, Patient_Customer__c, PA_NO_PA__c,Provider__c, Client_Insurance__c,Authorization_Number__c,
            Client_Name__c, Provider_Name__c, Location_Name__c,Insurance_Name__c, Sup_Provider__r.Name FROM Case WHERE Recordtype.Name ='Session'
             ORDER BY OwnerId limit 1800];


             if(newEvents.contains(OldValue)){
               newEvents1.addAll(newEvents);
             }

             system.debug('new history'+ newEvents1);
I tried with listname.contains('OldValue') but it's not working. Please if someone can suggest right approach. It will be very helpful.
 
This is my code:
 
public without sharing class AS_TriggerQuoteEvent {

    @InvocableMethod( label = 'Trigger Quote')

    public static void triggerQuoteEvent(List<Request> requestList) {
        system.debug('requestList >>' +requestList);

        for(Request req : requestList){
            if ( req.event != null ){
                Database.update ( req.event );
            } else {
                Database.update ( req.events );
            }
        }
    }

    public class Request {

        @InvocableVariable( label = 'Events')
        public List<sObject> events;
        
        @InvocableVariable( label = 'Event')
        public sObject event;
    }
}

Thanks in Advance
I am doing this for so many objects , but i have observed that three objects in my org is not having the option "List View Button Layout" itself. Rest of the objects are having this option. All are custom objects btw Can anyone tell me what might be the reason for this. PS: I am in lightning environment only.