• Ganesh Hembram 21
  • NEWBIE
  • 37 Points
  • Member since 2017

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 21
    Replies
hi all,
 i want to create a formula for measuring if a case has been handled within 24 hours.
how to do it ?
Any suggestions?
I have created activities with due date, createddate and lastmodifieddate one year earlier then todays date, but the activities are still visible in timeline, I read a post that Salesforce archives activities every saturday, if anyone knows the schedule of salesforce archiver that will be great help.
Hi all

I am using <lightning:navigation>component and page reference to navigate the user from one component to another component. Basically I am displaying a list of items in first component and the detail in second component. Now if I click on first item, it navigates to second component and displays the details. It works fine for the first time. When the user clicks the another item the second time, the detail of first item is displayed as the second component's INIT METHOD NOT EXECUTED. 

Did anyone has faced similar issue? Please let me know if you have any solution.

Thanks
APEX CLASS


trigger updatePtCDetails on OtB__c (after update) 
{
    List<id> caseIds = new List<id>();
    List<id> PCaseids = new List<id>();
    List<case> prntchildlist = new List<case>();
    List<case> updcaselist=new List<case>();
    Set<String> gbS = SMCUtils.getSOrgs('G P');

    if(trigger.isAfter && trigger.isUpdate)
    {
        for(OtB__c B : trigger.new)        
        {
            if(B.Result__c == 'Success' && B.Dt_Issued__c != null)
                caseIds.add(B.Case__c);
        }
        system.debug('case ids from B -->'+caseIds);
        if(!caseIds.isEmpty()){
            for(Case cs :[select id, PtId, SX_Is_Pt_Case__c from case where id in :caseIds AND Reasons__c = 'System Generated' AND S_OG__c in :gbS]){
                if(cs.SX_Is_Pt_Case__c){
                    PCaseids.add(cs.id);
                }else
                {
                    if(cs.prntId!=null){
                        PCaseids.add(cs.PtId);
                    }else
                    {
                        PCaseids.add(cs.id);

                    }
                }          
            }
        }
        system.debug('parent ids list -->'+PCaseids);   
        if(!PCaseids.isEmpty()){
            prntchildlist=[select id,Reasons__c,C_Status__c,(select id,C_Completed_On__c from Cases) from case where id in :PCaseids];
        }
        system.debug('parent child list -->'+prntchildlist);
        for(Case parent : prntchildlist)
        {
            Boolean isDateNull=false;
            for(Case child : parent.cases)
            {
                if(child.C_Completed_On__c==null)
                {
                    isDateNull=true;
                    break;
                }
            }
            if(isDateNull==false)
            {
                parent.C_Status__c='Process Complete';
                updcaselist.add(parent);
            }   
        }
        if(!updcaselist.isEmpty())
        {
            system.debug('inside update for case list in B-->'+updcaselist);
            update updcaselist;
        }

    }
}


TEST CLASS


@isTest
public class updatePtCDetailsTest
{
    static testMethod void TestMethod1()
    {
        Test.startTest();
        List<OtB__c> otlist =[select id,Case__c,Result__c,Dt_Issued__c from OtB__c limit 1];   
            if(!ologlist.isEmpty())
            {
                otlist[0].Dt_Issued__c=system.today();
                otlist[0].Result__c='Success';
                update otlist;
            }    
        Test.stopTest();
    }
    static testMethod void TestMethod()
    {       
        Test.startTest();
        Set<String> gbS = SMCUtils.getSOrgs('G P');
        List<Case> cs=[select id, PtId, SX_Is_Pt_Case__c,CCDetails__c from case where Reasons__c = 'System Generated' AND S_OG__c in :gbS AND CCDetails__c!=null
        limit 1];
        if(!cs.isEmpty())
        {  
            List<OtB__c> otlist =[select id,Case__c,Result__c,Dt_Issued__c from OtB__c 
            where Case__c=:cs[0].CCDetails__c limit 1];
            if(!otlist.isEmpty())
            {
                otlist[0].Dt_Issued__c = null;
                otlist[0].Result__c='Success';
                update otlist;
            }
        }
        Test.stopTest();
    }
}

The bold and underlined part is not able to cover. please help me out for this.. urgent...
  • August 01, 2018
  • Like
  • 0
Hello Team
I am new to Salesforce and i was struck with the Requirement  
Need an formula field of text and display Consultant id and dash seperated with control degits
<9876543210>  -  Control Degit ( two decimul Places)

Regards
NK Sha
Hi All,

I have a requirement to send email to campaign members(Contacts) through Apex. Read few blogs where they mentioned if I am sending emails to internal user, contact or lead using "setTargetObjectId" then it won't count under daily limit. So, I have written following code in my dev org to test:
----------------------------------------------------------------------------------
Messaging.Email[] messages = new Messaging.Email[0];
EmailTemplate emt=[Select Id from EmailTemplate where DeveloperName = 'First_Campaign_Email'];

for(Contact objC : lstContact)
{
    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
    mail.setTargetObjectId(objC.Id);
    mail.setSenderDisplayName('System Admin');
    mail.setTemplateId(emt.Id);
    messages.add(mail);
}
Messaging.sendEmail(messages);

----------------------------------------------------------------------------------

Now, assume lstContact contains 2 contacts and after executing above code when I check workbench for limits, I can see it's reduced to number of email sent. Infact, after sending 15 emails from above code, I started getting "SINGLE_EMAIL_LIMIT_EXCEEDED" exception. Please help what I am missing here and any idea to send bulk(10K) email to internal Contacts?

User-added image

Thanks,
Harsh
Hi all,

How to retrieve all  reports using ANT


Thanks in advance
Hi All,

Account object is not visible in tab list, Could you please me help in adding acount object in to the tab for new user.
User-added image
Hi All,

I have written a trigger to update both opportunity and cumulative object.
My logic is working fine for the same I have written a test class. My code coverage is 81 % in Sandbox when I go for deployment in production ...during the validation am getting following error. Kindly let me know How to overcome from the below error.

User-added image
My trigger:

trigger UpdateAmountInWords on Opportunity (Before Update) {
List<Target__C> Tglist= New List<Target__C>();
List<Target__C> Tglist1= New List<Target__C>();
Map<String,ID> Mapfield = New map<String,ID>();
Map<String,ID> MapTele = New map<String,ID>();
List<Incentive__c >lstInc =New list<Incentive__c >();
List<Incentive__c >lstInc1 =New list<Incentive__c >();
List <Cumulative__c> Cumlist= New list <Cumulative__c>();
List <Cumulative__c> Cumlist1= New list <Cumulative__c>();
list<Cumulative__c > lstcum = new list<Cumulative__c >(); 
list<Opportunity > opplist = new list<Opportunity >(); 
 Utils u = new Utils();
       For(Opportunity opp:Trigger.New){ 
       // Update opporunity Amount In Words
        opp.Amount_To_Words_Total_Amount_With_Tax__c = u.convert(opp.Total_Amount_With_IGST__c.longValue())+' Only'; 
        opp.Amount_To_Words_Total_Tax_Amount__c = u.convert(opp.Total_Tax_Amount__c.longValue())+' Only'; 
        //            
       Mapfield .put(opp.Field_Executive__c,opp.ID);MapTele.put(opp.Hidden_Owner_Name__c,opp.ID);}
       
TGlist1=[select ID, name from target__C where Name in:Mapfield.keyset() and Active__c=True];           
TGlist=[select ID, name from target__C where Name in:MapTele.keyset() and  Active__c=True];
            for(Opportunity opp: trigger.new ) { 
                    if(TGlist1.size()>0){if(opp.Field_Executive__c==TGlist1[0].NAme){
                                   opp.Target__C= TGlist1[0].ID; } }
                    IF(TGlist.size()>0){if(opp.Hidden_Owner_Name__c==TGlist[0].NAme){   
                                   opp.Telecaller__c=TGlist[0].ID;}}         
            If(opp.Telecaller__c!=Null && opp.Cumulative_Updated__c==False && opp.Work_Order_Created_Date__c!=Null ){
              Cumlist=[select ID,Target__c,Type1_Customer_Order_value_MPD__c,Type1_Customer_Order_Value_PD__c,Type2_Customer_Order_value_MPD__c,Type2_Customer_Order_value_PD__c,Type3_Customer_Order_value_MPD__c,Type3_Customer_Order_value_PD__c,Type4_Customer_Order_value_MPD__c,Type4_Customer_Order_value_PD__c,From_Date__c,To_Date__c from Cumulative__c where Target__c=:opp.Telecaller__c and  From_Date__c<=:opp.Work_Order_Created_Date__c and To_Date__c>=:opp.Work_Order_Created_Date__c];
                   if(Cumlist.size()>0){For(Cumulative__c Cum:Cumlist){lstInc = [select ID from Incentive__c where ID =:Opp.IncentiveSlab__c and Opp_Discount_To__c>=:opp.Discount__c]; 
                        If(lstInc.size()>0 ){If(Opp.Customer_Slab_Type__c=='Type 4'){           
                                Cum.Type4_Customer_Order_value_PD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 2'){Cum.Type2_Customer_Order_value_PD__c+= opp.Individual_Order_value__c; opp.Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 3'){Cum.Type3_Customer_Order_value_PD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 1'){Cum.Type1_Customer_Order_Value_PD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                             }} IF(lstInc.size()<=0 ){If(Opp.Customer_Slab_Type__c=='Type 4'){Cum.Type4_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                            }Else IF(Opp.Customer_Slab_Type__c=='Type 2'){Cum.Type2_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                            }Else IF(Opp.Customer_Slab_Type__c=='Type 3'){Cum.Type3_Customer_Order_value_MPD__c += opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                            } Else IF(Opp.Customer_Slab_Type__c=='Type 1'){Cum.Type1_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                            } }lstcum .add(Cum);opplist.add(opp);} } } 
         If(opp.Target__C!=Null && opp.FE_Cumulative_Updated__c==False && opp.Work_Order_Created_Date__c!=Null ){               
              Cumlist1=[select ID,Target__c,Type1_Customer_Order_value_MPD__c,Type1_Customer_Order_Value_PD__c,Type2_Customer_Order_value_MPD__c,Type2_Customer_Order_value_PD__c,Type3_Customer_Order_value_MPD__c,Type3_Customer_Order_value_PD__c ,Type4_Customer_Order_value_MPD__c,Type4_Customer_Order_value_PD__c,From_Date__c,To_Date__c from Cumulative__c where Target__c=:opp.Target__C and From_Date__c<=:opp.Work_Order_Created_Date__c and To_Date__c>=:opp.Work_Order_Created_Date__c];
               if(Cumlist1.size()>0){For(Cumulative__c Cum:Cumlist1){ 
                       lstInc1 = [select ID from Incentive__c where ID =:Opp.IncentiveSlab__c and Opp_Discount_To__c>=:opp.Discount__c]; 
                        If(lstInc1.size()>0 ){If(Opp.Customer_Slab_Type__c=='Type 4'){ Cum.Type4_Customer_Order_value_PD__c+= opp.Individual_Order_value__c;opp.FE_Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 2'){Cum.Type2_Customer_Order_value_PD__c+= opp.Individual_Order_value__c;opp.FE_Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 3'){Cum.Type3_Customer_Order_value_PD__c += opp.Individual_Order_value__c; opp.FE_Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 1'){Cum.Type1_Customer_Order_Value_PD__c+= opp.Individual_Order_value__c;   opp.FE_Cumulative_Updated__c=True;
                             }} IF(lstInc1.size()<=0 ){ If(Opp.Customer_Slab_Type__c=='Type 4'){Cum.Type4_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c; opp.FE_Cumulative_Updated__c=True;
                        }Else IF(Opp.Customer_Slab_Type__c=='Type 2'){ Cum.Type2_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c; opp.FE_Cumulative_Updated__c=True;
                        }Else IF(Opp.Customer_Slab_Type__c=='Type 3'){ Cum.Type3_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c; opp.FE_Cumulative_Updated__c=True;
                        } Else IF(Opp.Customer_Slab_Type__c=='Type 1'){Cum.Type1_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c;opp.FE_Cumulative_Updated__c=True;}        
                        }lstcum .add(Cum); opplist.add(opp);
                      } } } 
                      update lstcum ; }}

 
Hi ,

Could anyone please explain me to set the filed level security to mandatory fileds of an object.

 
Hi All,
Is it possible to change the visibility of an object for different Apps but same profile. I have 2 apps and I am seeing all the objects created from App 1 in App 2. Please let me know how to restrict it? 
Here you attended Capgemini written test. If you got selected here you will be sent to technical round..if you got selected in the technical round then you will be sent to HP for client interview, because HP is the client to Capgemini. If you got selected finally.Then you will be put into work.  This is the scenario. which process do you apply here either “WORKFLOWS” or “APPROVALS“. What will be answer of this question?
hi all,
 i want to create a formula for measuring if a case has been handled within 24 hours.
how to do it ?
Any suggestions?

Hi Folks,

I have created a quick action and added it in two case page layouts. It is displaying on Feed section in classic for each records for each layouts , but in Lightning experience it is not visible for only one pagelayout. Also I found that only Post and Pull actions are  vailable for that case layout, and other actions are not available.

Any idea ???

  • June 29, 2018
  • Like
  • 0
Hi! I have a problem - when I change the opportunity probability from 75% to 100%, automatically changes business date. Up to now everything was okay - the business date stayed the same as it supposed to be. Can anyone help me with this?