• Vishal K S
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 0
    Replies
Hi ,

Can anyone help test class for below.


@RestResource(urlMapping='/dcleads')
global without sharing class DC_RestResourceCls {
    
    @HttpPost
    global static PostResponseWrapper doPost() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        PostResponseWrapper response = new PostResponseWrapper();
       
        intreq__c integrationObj = New intreq__c();
        try {
            LeadWrapper LeadWrapperObj = (LeadWrapper)JSON.deserialize(req.requestBody.toString(), LeadWrapper.class);
            
            integrationObj.Request_Body__c = req.requestBody.toString();
            List<lead> ld = [SELECT id,APIMOBILE__c,Call_Stage__c,Status,DC_Lead_Status__c,CreatedDate,convertedAccountId,convertedOpportunityId,
                             Follow_Up_Date_Time__c,FirstName,LastName,Meeting_Type__c,Meeting_Venue__c,Email,Country_Code__c,Home_Type__c,
                             Property_Possession_Status__c,Preferred_Time_to_Contact__c,Voucher_Code__c,Page_URL__c,Project_Name__c,OwnerId,
                             City,GClid__c,Area__c,Device_Name__c,Campagin__c,Ad_Group__c,Keyword__c,Match_Type__c,First_Visit_Time__c
                             from Lead WHERE APIMOBILE__c =:LeadWrapperObj.Mobile Limit 1];
            IF(ld.size() != 0){ 
                
                
                if((ld[0].Status == 'Followup' && LeadWrapperobj.dsaid!=Null && (ld[0].Follow_Up_Date_Time__c < system.today().addDays(-29) || ld[0].LastModifiedDate < system.today().addDays(-29)))||
                   (ld[0].Call_Stage__c == 'Undialed' && LeadWrapperobj.dsaid!=Null && ld[0].LastModifiedDate < system.today().addDays(-29))||
                   (ld[0].Status == 'Junk' && LeadWrapperobj.dsaid!=Null)||
                   (ld[0].DC_Lead_Status__c =='Qualified' && LeadWrapperobj.dsaid!=Null && (ld[0].Follow_Up_Date_Time__c < system.today().addDays(-29) || ld[0].LastModifiedDate < system.today().addDays(-29)))
                  )
                  {
                //---------------- Attribution DSA(1) ------------------------------//
                //---------------- Logic 1 ------------------------------//
                }
                else if(LeadWrapperobj.dsaid!=Null){
                    Lead LeadObj = new Lead();
                    LeadObj.id = ld[0].id;
                    LeadObj.DC_Lead_Status__c = 'Recontacted';
                    LeadObj.Re_Contact_Date__c = System.now();   
                    update LeadObj;
                    response.message = 'Updated Successfully -1[Record Already Exists]';
                    response.status  = 'Success';
                    response.recordId = LeadObj.id;
                }    
                
                }}}}
Hi There,

I want to create tab for Custom Big Object, can anyone help me to know how to create tabs for Big Object.



Thanks in advance.