• karthik Jonnalagadda
  • NEWBIE
  • 55 Points
  • Member since 2015
  • Prodigy systems and services Pvt.Ltd

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 28
    Questions
  • 34
    Replies
Hello All,

I want to apply field dipendency for two different objects fields, How can I achive this ?

Thanks in advance.
Hello All,

I am trying to display contacts in the vsf page.as follows and now I have to submit the stage and Closed Date values to different object. Please let me know how can I achive this. 
VSF Page 
Hello all,

I wrote a web service to insert  values into object. Its working fine. but when I am tring to call it from Test method I am not able to get the lookup values The query returnig zero values. 

My Web service:
try
{         RestRequest req = RestContext.request;
         String bdy = req.requestBody.toString(); 
         new_whitepaper_registration whitepaper = (new_whitepaper_registration)JSON.Deserialize(bdy,new_whitepaper_registration.class);
         White_Papers__c ObjWhitePaper =New White_Papers__c(); 
 		 ObjWhitePaper.Name=whitepaper.Name;
 		 ObjWhitePaper.Document_Name__c=whitepaper.DocumentName;
         ObjWhitePaper.White_Paper_Id__c=whitepaper.WhitePaperId;  		
         ObjWhitePaper.Lead_Name__c=[select ID from Lead where Name=:whitepaper.LeadName Limit 1].ID;   
 		insert ObjWhitePaper;	
         
   return new ReturnClass('True');
}
catch(Exception ex)
{
system.debug('ERROR: '+ex.getMessage()+ ' '+ex.getStackTraceString());   
 return new ReturnClass('false');
    
}
My Test Class: 
 
@isTest
public class CreateNewWhitePaperTest {
static testmethod void TestCreateNewWhitePaper()
    {
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        req.requestURI = 'https://offerboard--dev1.cs17.my.salesforce.com/services/apexrest/CreateWhitePaper';  
      req.httpMethod = 'POST';
        req.requestBody=Blob.valueof('{"Name":"Test White Paper","WhitePaperId":"123","DocumentName":"Demo Doc","LeadName":"Punam Sharma"}');
        RestContext.request = req;
       RestContext.response = res;
        CreateWhitePaper.ReturnClass results = CreateWhitePaper.NewWhitePaper();      
      
   		 System.assertEquals('True', results.success);
       
       
      
        
      
    }
}


 
if('{! User.Profile }'=='Excutive'){
window.parent.location.href="https://composer.congamerge.com?SessionId={!API.Session_ID}
&ServerUrl={!$Api.Partner_Server_URL_290}
&Id={!Ibanking_Project__c.Id}&QueryId=[Q1]a0Tg0000002eOMq,[Q2]a0Tg0000002eORQ&TemplateId=a0Ug0000002el92";
}else{
alert("No Access");
}


 
I want to hide custom button for some profile. What is the best way to achive this.
Hello All, 

I am tring to write test class for trigger (after delete ). I am Getting "Methods defined as TestMethod do not support Web service callouts, test skipped" this error while runing test class 

Please help me out 

Thanks in advance 
Hello all,

Methods defined as TestMethod do not support Web service callouts, test skipped

can anybody tell what that mean.
 
@isTest
public class TestSetIsCopiedToProjectFlagFalse {
 static testmethod void UnitTest()
    {
      
         Account objAcc = new Account(Name = 'karthik test');
          insert objAcc;
     
    Ibanking_Project__c  objIbanking_Project = new Ibanking_Project__c();
       objIbanking_Project.Name='karthiktest trigger';
        objIbanking_Project.Company__c=objAcc.Id;
          Insert objIbanking_Project;

          Delete objIbanking_Project;
    
    }
}

 
Hello all,

I write a test case for trigger, I got code coverage  72% but while pushing into production it showing code coverage is 0% need at least 1 %.

what was the issue please any solutions  
@isTest
public class TestSetIsCopiedToProjectFlagFalse {
static testmethod void TestTriggerIsCopiedToProjectFlag()
    {
      
     Ibanking_Project__c Obj = new  Ibanking_Project__c();      
     
        obj.Id='a0Bj00000031Gu6';
        delete obj;
     
          
        
      
    }
}

 
Hi all,

Any one can please give a sample code (Insert class and Test class ) from insert and update record into Lead Object. 


Thanks in advance 
Hello All,

I Have CreateNewLead class and CreateNewLeadTest classes. I run the test class it showing test is passes but Code Coverage 0% (0/20). What was the reson Please help out . code bellow.
@RestResource(urlMapping='/CreateNewLead/*')
global class CreateNewLead
{

@Httppost

global static void NewLead()
{
try
{

 RestRequest req = RestContext.request;

        String bdy = req.requestBody.toString();
       
         new_member_registration member = (new_member_registration)JSON.Deserialize(bdy,new_member_registration.class);
          List<Lead> NoLeads=[Select ID from Lead where Offerboard_Member_ID__c=: member.memberId];
         
          Lead l = New Lead();
            if(String.isNotBlank(member.firstName) && String.isNotEmpty(member.firstName))
               l.FirstName = member.firstName;
                if(String.isNotBlank(member.lastName) && String.isNotEmpty(member.lastName))
                l.LastName = member.lastName;
                 if(String.isNotBlank(member.memberId) && String.isNotEmpty(member.memberId))
                l.Offerboard_Member_ID__c = member.memberId;
                 if(String.isNotBlank(member.companyName) && String.isNotEmpty(member.companyName))
                l.Company = member.companyName;
                 if(String.isNotBlank(member.memberType) && String.isNotEmpty(member.memberType))
                l.Member_Type__c = member.memberType;
                 if(String.isNotBlank(member.email) && String.isNotEmpty(member.email))
                l.Email = member.email;
                if(String.isNotBlank(member.phone) && String.isNotEmpty(member.phone))
                l.Phone = member.phone;                 
                l.Date_Member_Joined__c = member.datejoined == null ? null : member.datejoined.date();
               
                Database.SaveResult sr;          
         if(NoLeads.size()==0)
         {
           
                sr = database.insert(l,false);
                 
                 }
                 else
                 {
                 l.ID=NoLeads[0].ID;
                sr = database.update(l,false);          
                       }
                   
         
}
catch(Exception ex)
{
system.debug('ERROR: '+ex.getMessage());
 
}

}

  public class new_member_registration{
    public String memberId;
    public String memberType;
    public String firstName;
    public String lastName;
    public String companyName;
    public String email;
    public DateTime datejoined;
    public String phone;
  }  


}

Test Class  code
@isTest
Private class CreateNewLeadTest {
  testmethod Private static void TestCreateNewLead()
    {
        Lead ObjLead=new Lead(FirstName ='karthik-test',LastName ='reddy-Test',Offerboard_Member_ID__c ='1234567',Company ='Test-Company',Member_Type__c ='Investor',Email ='karthik@test.com',Phone ='9032793424',Date_Member_Joined__c=Date.today());
        Insert ObjLead;
        Lead L=[select Offerboard_Member_ID__c from lead where id=:ObjLead.id];
        system.assertEquals(L.Id, ObjLead.Id);
        
      
    }
}

 
Hello all,

While I am pushing sandbox stuff to production I am getting the code coverage error Please anyone suggest the solution.User-added image
Hi,

how to add custom button in related list in page layout in salesforce, My button is not showing in avilable buttons, Is this somthing related permission issue. 
Hello All,

I have one custom button in custom object view details page. I want enable or disable button based on condition whether current record exits on another custom object. Is is possible ? if so please suggest some steps to do
Hi,

How to call a apex class on page  load standard sales force page.
Hello,

How to insert Values into object from VisualForce page.
I want to insert check box selected values into another object. 
User-added image

Thanks in Advance.
Hi all,

I have created a custom button Display Type Detail Page Button to execute Visualforce page.I Need add that button to Related list in custom layout but button is not showing up, What was the reason?
User-added image
User-added image

Thanks in Advance
Hi All,

I Have created a visualforce page and I tring to access that page from on button click, But it is not showing Previously created VisualForcepage.
what was the reason should change any permissions ?
User-added image
User-added image
Hi,
I am getting bellow error while adding a record into projects object, what is this exactly mean.

Error: Invalid Data. 
Review all error messages below to correct your data.
You must have a Group Name in order to create Projects. Contact an LM2 Admin in order to correct.
Hi,

How to dump production data to sandBox
Hi all,

I need to insert a values into record type field from Apex code. I saw the data type  as (Record Type). How should i insert Into Record Type filed.
Hello all,

I wrote a web service to insert  values into object. Its working fine. but when I am tring to call it from Test method I am not able to get the lookup values The query returnig zero values. 

My Web service:
try
{         RestRequest req = RestContext.request;
         String bdy = req.requestBody.toString(); 
         new_whitepaper_registration whitepaper = (new_whitepaper_registration)JSON.Deserialize(bdy,new_whitepaper_registration.class);
         White_Papers__c ObjWhitePaper =New White_Papers__c(); 
 		 ObjWhitePaper.Name=whitepaper.Name;
 		 ObjWhitePaper.Document_Name__c=whitepaper.DocumentName;
         ObjWhitePaper.White_Paper_Id__c=whitepaper.WhitePaperId;  		
         ObjWhitePaper.Lead_Name__c=[select ID from Lead where Name=:whitepaper.LeadName Limit 1].ID;   
 		insert ObjWhitePaper;	
         
   return new ReturnClass('True');
}
catch(Exception ex)
{
system.debug('ERROR: '+ex.getMessage()+ ' '+ex.getStackTraceString());   
 return new ReturnClass('false');
    
}
My Test Class: 
 
@isTest
public class CreateNewWhitePaperTest {
static testmethod void TestCreateNewWhitePaper()
    {
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        req.requestURI = 'https://offerboard--dev1.cs17.my.salesforce.com/services/apexrest/CreateWhitePaper';  
      req.httpMethod = 'POST';
        req.requestBody=Blob.valueof('{"Name":"Test White Paper","WhitePaperId":"123","DocumentName":"Demo Doc","LeadName":"Punam Sharma"}');
        RestContext.request = req;
       RestContext.response = res;
        CreateWhitePaper.ReturnClass results = CreateWhitePaper.NewWhitePaper();      
      
   		 System.assertEquals('True', results.success);
       
       
      
        
      
    }
}


 
Hello All, 

I am tring to write test class for trigger (after delete ). I am Getting "Methods defined as TestMethod do not support Web service callouts, test skipped" this error while runing test class 

Please help me out 

Thanks in advance 
Hello all,

Methods defined as TestMethod do not support Web service callouts, test skipped

can anybody tell what that mean.
 
@isTest
public class TestSetIsCopiedToProjectFlagFalse {
 static testmethod void UnitTest()
    {
      
         Account objAcc = new Account(Name = 'karthik test');
          insert objAcc;
     
    Ibanking_Project__c  objIbanking_Project = new Ibanking_Project__c();
       objIbanking_Project.Name='karthiktest trigger';
        objIbanking_Project.Company__c=objAcc.Id;
          Insert objIbanking_Project;

          Delete objIbanking_Project;
    
    }
}

 
Hello all,

I write a test case for trigger, I got code coverage  72% but while pushing into production it showing code coverage is 0% need at least 1 %.

what was the issue please any solutions  
@isTest
public class TestSetIsCopiedToProjectFlagFalse {
static testmethod void TestTriggerIsCopiedToProjectFlag()
    {
      
     Ibanking_Project__c Obj = new  Ibanking_Project__c();      
     
        obj.Id='a0Bj00000031Gu6';
        delete obj;
     
          
        
      
    }
}

 
Hi all,

Any one can please give a sample code (Insert class and Test class ) from insert and update record into Lead Object. 


Thanks in advance 
Hi,

how to add custom button in related list in page layout in salesforce, My button is not showing in avilable buttons, Is this somthing related permission issue. 
Hi all,

I have created a custom button Display Type Detail Page Button to execute Visualforce page.I Need add that button to Related list in custom layout but button is not showing up, What was the reason?
User-added image
User-added image

Thanks in Advance
Hi,
I am getting bellow error while adding a record into projects object, what is this exactly mean.

Error: Invalid Data. 
Review all error messages below to correct your data.
You must have a Group Name in order to create Projects. Contact an LM2 Admin in order to correct.