• Roshan singh 21
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 13
    Replies
Hi I need to show a group of product name as a single name on the lighting page and add quantity for all product 
Example: 
SubscriptionProduct NameQuantity Subscription Details
SUB-0000001    ABC2 abc product Details 1
SUB-0000002   ABC5 abc product Details 2
SUB-0000003   ABC3 abc product Details 3
SUB-0000004   XYZ4 xyz product Details 1
SUB-0000005   ZYZ5 xyz product Details 2
SUB-0000006   ZYZ2 xyz product Details 3

But I need to show like this
Product NameQuantity  Subscription Details
   ABC 10 
   XYZ 11 

Please help me with how I can get this.
I am new to lightning.

Thanks in advance

 
how to show parent-related child record in lighting page using Lighting component and also there should be filter functionality like if child record having status filed Status__c.
1. on page load parent-related all child record needs to show 
2. If user select status value equal to Active then all active record need to show.
2. If user select status value equal to Inactive then all inactive record need to show.

Object parent object = Account
Child object = Contract 
Contract object fields:- Name, Status, StartDate__c

I am new to lighting. please help me.
It's very very urgent 

Thanks in Advance. 

how to show parent-related child record in lighting page using Lighting component and also there should be filter functionality like if child record having status filed Status__c.
1. on page load parent-related all child record needs to show 
2. If user select status value equal to Active then all active record need to show.
2. If user select status value equal to Inactive then all inactive record need to show.

Object parent object = Account
Child object = Contract 
Contract object fields:- Name, Status, StartDate__c



I am new to lighting. please help me.
It's very very urgent 
Thanks in Advance. 

Hi, I am working on zuora CPQ integration.
When Quote created in Salesforce by adding select the product then save the event, I want to send a post request to rest API endpoint URL to zuora CPQ then i should get a response based on requested response. 
Hi All,

How to write a test class for process builder. If I have created approval Process for Case, based on some condition.
how to write a test class for this approval process.

Thanks in Advance 
 
Hi All,

I am having one 3 object 
Note:- Account and SalesPreson__c object is not related to each other directly.
1. Account (Country__c, State__C)
2. SalesPreson__c(Country__c,State__C)
2. Opportunity( Opportunity object having Account & SalesPreson__c is lookup field)
my scenario is if the user is selecting Account and if Account country is India & State is Delhi then the second lookup field that is SalesPreson__c in this lookup search page in need to display only that Salesperson name which belongs from country India and State  Delhi.

Please, tell me how can I achieve this using trigger.
Thanks in advance.
It's very urgent.



 

Hi All,
My current scenario I got stuck. please help me 
I am an opportunity object where Account is lookup field. and now i want to validate account county field with licence object country filed that is not directly related to Account object.
But  User object is having a relationship with License object. user and license having one to one relationship
now when the user is trying to create opportunity and selecting an account then I need to write validation if selected account country is same as User ->licence object country field then the only user can create the opportunity else throw an error. 

Object details:
       1. user
       2. License
       3. Opportunity 
       4. Account

now licence is having country__c field and account is having Shippingcountry field I need to write a trigger to throw an error.
Please help me it's very urgent 

Thanks in advance
Amit

       


 

 

Hi All,

Please help me to write a trigger to validate and send mail when validation error comes.
  1. While a user is creating Opportunity and selecting Account in the opportunity page then need to check if the Account having Country and State is same as Individual object County and state then a user can able to create opportunity else throw an error and send mail to a current user's manager.  
User-added image

Please help me how to write trigger for this seenario?

 
Hi All,
public class IssuersCalloutController {

    public IssuersCalloutController(ApexPages.StandardController controller) {

        }    
            
    public PageReference callhttp(string serviceURL)
        {
            System.debug('mytest method');
            Http h = new Http();
            HttpRequest req = new HttpRequest();
            req.setEndpoint(serviceURL);
            req.setMethod('GET');
            req.setHeader('Content-Type', 'application/json');
            req.setHeader('Accept','application/json');
            system.debug('request endpoint '+ req);    
            String username = 'amit';
            String password = 'Password';
        
            Blob headerValue= Blob.valueOf(username + ':' + password);
            system.debug('headerValue'+ headerValue);
            String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
            req.setHeader('Authorization', authorizationHeader);
            req.setTimeout(60000);
        
            system.debug('###req### '+ req);            
            HttpResponse res = h.send(req);
            system.debug('###res### '+ res);
        
            string response = res.getBody();
            system.debug('response'+ response);
               
                
            Set<String> bankNames = New Set<String>();
            // declare issuer list to insert 
            List<Issuers__c> InsertedIssuers = New List<Issuers__c>();
            for(Issuers__c issuer : [Select Id,Bankdir_Name__c from Issuers__c LIMIT 50000]){
            If(!string.isBlank(issuer.Bankdir_Name__c))
                {
                bankNames.add(issuer.Bankdir_Name__c);                          
                }
            }
            system.debug('###Bank Name### '+ bankNames.size());
            List<JsonParserDetail> responseDetails = JsonParserDetail.parse(response); 
            system.debug('****responseDetails****** '+responseDetails);
        
            if(responseDetails.size() > 0){
            for(JsonParserDetail jpd : responseDetails){
                If(!bankNames.contains(jpd.issuerBankdirName))
                    {
                        InsertedIssuers.add(getIssuer(jpd.issuername,jpd.issuerBankdirName,jpd.processorName,jpd.subProcessorName,jpd.siloName));
                    }
                }
            }
            If(InsertedIssuers.size() >0){
            insert InsertedIssuers;      
            }
            PageReference p = apexPages.currentPage();
            string siloName = getsiloname(serviceUrl);
            string message=siloName+' list Successfully updated'+ (InsertedIssuers.size())+'"Thank you!';
            ApexPages.Message msg=new ApexPages.Message(ApexPages.Severity.CONFIRM,message);
            ApexPages.addMessage(msg);
            return p;
        }
 
 
    public string getsiloname(string url) {
            if(url.contains(‘test1’)) {
                return ‘test1';
                }   
            else if(url.contains('test2')) {
                return 'test2';
                }
            else if(url.contains(‘test3’)) {
                return ‘test3';
                }
            else if(url.contains(‘test4’)) {
                return ‘test4';
                }
            else if(url.contains('test5')) {
                return 'test5';
                }
            else if(url.contains('test6')) {
                return 'test6';
                }
                else {                
                return '';
                }
            }

    public PageReference savePreview2Result(){
        PageReference p = callhttp('https://test1/getIssueList' )
            return p;
        }
    
    public PageReference savePreview4Result(){
        PageReference p = callhttp('https://test2/getIssueList' ); 
            return p;
        }
    
    public PageReference savePreview5Result(){
        PageReference p = callhttp('https://test3/getIssueList' ); 
            return p;
        }
    
    public PageReference savePreview7Result(){
        PageReference p = callhttp('https://test4/getIssueList' ); 
            return p;
        }
    public PageReference saveTsysResult(){
       PageReference p = callhttp('https://test5/getIssueList' ); 
            return p;
        }
       
    public PageReference saveMyscResult(){
        PageReference p = callhttp('https://test6/getIssueList' ); 
            return p;
        }
  
          
    public Issuers__c getIssuer(string iName, string ibName, string pName, string spName,string siloName){
    
            Issuers__c issuer = New Issuers__c();
            issuer.Name = iName;
            issuer.Bankdir_Name__c = ibName;
            issuer.Processor_Name__c = pName;
            issuer.SubProcessor_Name__c = spName;
            issuer.Silo_Name__c = siloName;
            return issuer;
        }
    }



My test class 1:-
@isTest
global class MockHttpResponseGenerator implements HttpCalloutMock {

        global HTTPResponse respond(HTTPRequest req) {               
        System.assertEquals('https://test2/getIssueList', req.getEndpoint());                  
        HttpResponse res = new HttpResponse();
        String body = strBody;
        res.setHeader('Content-Type', 'application/json');
        res.setBody(body);
        res.setStatusCode(200);
        return res;
    }
    
     public static final string strBody = '{'+       
        '           "processorName": "PSCUFFFS",'+
        '           "siloName": "Preview",'+
        '           "issuername": "Trumark ", '+
        '           "issuerBankdirName": "4735", '+
        '           "subProcessorName": "PSAgCU"'+
        '}'; 
}
Test Class 2:-
@isTest
private class IssuersCalloutController_Test{
     @isTest static void testCallout() {
     
    PageReference pageRef = Page.ImpactedIssuerVFpage;
    Test.setCurrentPage(pageRef);

    Issuers__c issuer = New Issuers__c();
        issuer.Name = 'Test'; 
        issuer.Bankdir_Name__c =  'Test'; 
        issuer.Processor_Name__c = 'Test'; 
        issuer.SubProcessor_Name__c = 'Test'; 
        issuer.Silo_Name__c =  'Test'; 
        insert issuer ;
            
        Test.StartTest(); 
        ApexPages.currentPage().getParameters().put('Id', String.valueOf(issuer.Id));
        ApexPages.StandardController sc = new ApexPages.StandardController(issuer);        
        IssuersCalloutController ic = new IssuersCalloutController(sc);
        Test.setMock(HttpCalloutMock.class, new MockHttpResponseGenerator());        
        ic.getsiloname('URL');           
        ic.savePreview2Result();     
        ic.getIssuer('Test1', 'Test2', 'Test3', 'Test4','Test5');
        Test.StopTest(); 
         }
    }

Please help me it's urgent
Hi All Please help me to write Test Class for mu class
public class IssuersCalloutController {

    public IssuersCalloutController(ApexPages.StandardController controller) {

        }    
            
    public PageReference callhttp(string serviceURL)
        {
            System.debug('mytest method');
            Http h = new Http();
            HttpRequest req = new HttpRequest();
            req.setEndpoint(serviceURL);
            req.setMethod('GET');
            req.setHeader('Content-Type', 'application/json');
            req.setHeader('Accept','application/json');
            system.debug('request endpoint '+ req);    
            String username = 'amit';
            String password = 'dost1234';
        
            Blob headerValue= Blob.valueOf(username + ':' + password);
            system.debug('headerValue'+ headerValue);
            String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
            req.setHeader('Authorization', authorizationHeader);
            req.setTimeout(60000);
        
            system.debug('###req### '+ req);            
            HttpResponse res = h.send(req);
            system.debug('###res### '+ res);
        
            string response = res.getBody();
            system.debug('response'+ response);
               
                
            Set<String> bankNames = New Set<String>();
            // declare issuer list to insert 
            List<Issuers__c> InsertedIssuers = New List<Issuers__c>();
            for(Issuers__c issuer : [Select Id,Bankdir_Name__c from Issuers__c LIMIT 50000]){
            If(!string.isBlank(issuer.Bankdir_Name__c))
                {
                bankNames.add(issuer.Bankdir_Name__c);                          
                }
            }
            system.debug('###Bank Name### '+ bankNames.size());
            List<JsonParserDetail> responseDetails = JsonParserDetail.parse(response); 
            system.debug('****responseDetails****** '+responseDetails);
        
            if(responseDetails.size() > 0){
            for(JsonParserDetail jpd : responseDetails){
                If(!bankNames.contains(jpd.issuerBankdirName))
                    {
                        InsertedIssuers.add(getIssuer(jpd.issuername,jpd.issuerBankdirName,jpd.processorName,jpd.subProcessorName,jpd.siloName));
                    }
                }
            }
            If(InsertedIssuers.size() >0){
            insert InsertedIssuers;      
            }
            PageReference p = apexPages.currentPage();
            string siloName = getsiloname(serviceUrl);
            string message=siloName+' list Successfully updated'+ (InsertedIssuers.size())+'"Thank you!';
            ApexPages.Message msg=new ApexPages.Message(ApexPages.Severity.CONFIRM,message);
            ApexPages.addMessage(msg);
            return p;
        }
 
 
    public string getsiloname(string url) {
            if(url.contains('url')) {
                return 'url';
                }   
            else if(url.contains('url1')) {
                return 'Url1';
                }
            else if(url.contains('Url2')) {
                return 'Url 2';
                }
            else if(url.contains('Url3')) {
                return 'Url 3';
                }
            else if(url.contains('Url4')) {
                return 'Url4';
                }
            else if(url.contains('Url5')) {
                return 'Url5';
                }
                else {                
                return '';
                }
            }

    public PageReference savePreview2Result(){
        PageReference p = callhttp('https://url******1*********'); 
            return p;
        }
    
    public PageReference savePreview4Result(){
        PageReference p = callhttp('https://url1******2*********'); 
            return p;
        }
    
    public PageReference savePreview5Result(){
        PageReference p = callhttp('https://ur2******3*********'); 
            return p;
        }
    
    public PageReference savePreview7Result(){
        PageReference p = callhttp('https://url3******4*********'); 
            return p;
        }
    public PageReference saveTsysResult(){
       PageReference p = callhttp('https://url4******5*********'); 
            return p;
        }
       
    public PageReference saveMyscResult(){
        PageReference p = callhttp('https://url5******6*********'); 
            return p;
        }
  
          
    public Issuers__c getIssuer(string iName, string ibName, string pName, string spName,string siloName){
    
            Issuers__c issuer = New Issuers__c();
            issuer.Name = iName;
            issuer.Bankdir_Name__c = ibName;
            issuer.Processor_Name__c = pName;
            issuer.SubProcessor_Name__c = spName;
            issuer.Silo_Name__c = siloName;
            return issuer;
        }
    }


Class: 2

public class JsonParserDetail {
        
        public String issuername; 
        public String issuerBankdirName;        
        public String processorName;        
        public String subProcessorName;
        public String siloName;
               
       
    public static List <JsonParserDetail> parse(String json) {
        return (List<JsonParserDetail>) System.JSON.deserialize(json,List<JsonParserDetail>.class);
    }
}
Hi All,
Please check my code I am getting 71%code coverage. please help me.
My Controller:-
public class ImpactedIssuerController {


public ImpactedIssuerController(ApexPages.StandardController controller){ 

 
}
   
     Public String cid;
     public List<WrapIssuer> wrapIssuerList {get; set;}
     public Boolean selectAllCheckbox {get; set;}  
     public boolean errormsg=false; 
    
     String userinput;
     String userinp;
     String userinp2;
     String siloinput;
    
     public List<Issuers__c> allissuer = new List<Issuers__c>();
     public List<Issuers__c> selectedIssuer2 = new List<Issuers__c>();
     
     
     /* Getter and setter methods for getting the user input ie. Issuer name from the UI */
     public String getuserinput(){return userinput;}
     //public void setuserinput(String userinp){this.userinput=userinp=userinp2;}
     public void setuserinput(String userinp){this.userinput=userinp;}
     public String getuserinp(){return userinp;}
     public void setuserinp(String userinp){this.userinp=userinp;} 
     
     public String getuserinp2(){return userinp2;}
     public void setuserinp2(String userinp2){this.userinp2=userinp2;} 
     
     public String getsiloinput(){return siloinput;}
     public void setsiloinput(String siloinput){this.siloinput=siloinput;}
     
     
      /*End of Getter and Setter methods */
      
      
     /* Method to Search the Issuer database to fetch the query results */
      public List<Issuers__c> search() {
      
      errormsg=false;
      wrapIssuerList = new List<WrapIssuer>();
      for(Issuers__c ilist:[select Name,id,Bankdir_Name__c,Processor_Name__c,Subprocessor_Name__c,Silo_Name__c  from Issuers__c where Name like :userinput+'%' and Processor_Name__c like :userinp+'%' and Subprocessor_Name__c like :userinp2+'%' and Silo_Name__c like :siloinput+'%'LIMIT 1000 ])
        {
           wrapIssuerList.add(new WrapIssuer(ilist));
         }
         return null;
      }
      /* End of Search method */
       
       /* Method for returning the contact search results to the UI */
        public List<WrapIssuer> getresults()
            {
             return wrapIssuerList;
            }
        /* End of Method */
        
        
        /* Wrapper class to contain contact record and a boolean flag */
        public class WrapIssuer {
        public Issuers__c Issu {get; set;}
        public Boolean selected {get; set;}
 
        public WrapIssuer(Issuers__c ism) {
            Issu = ism;
            selected = false;
         }
        }
       /* end of Wrapper class */
       
       
      /* Method to fetch the selected records and save them to other other object */
      
   public List<Impacted_Issuers__c> cList=new List<Impacted_Issuers__c>();
    
    public PageReference processSelected() {
    List<Issuers__c> selectedIssuers = new List<Issuers__c>();
    //selectedIssuer= new List<Issuers__c>();
 
        for(wrapIssuer wrapIssuerObj : wrapIssuerList) {
            if(wrapIssuerObj.selected == true) {
                selectedIssuers.add(wrapIssuerObj.Issu);
            }
        }
    
     for(Issuers__c Issu:selectedIssuers){
     Impacted_Issuers__c imp =new Impacted_Issuers__c();
        imp.Name=Issu.name;
        imp.Bankdir_Name__c=Issu.Bankdir_Name__c;
        imp.Processor_Name__c=Issu.Processor_Name__c;
        imp.Subprocessor_Name__c=Issu.Subprocessor_Name__c;
        imp.Silo_Name__c=Issu.Silo_Name__c;
        imp.Development_Task__c =string.valueOf(apexpages.currentpage().getparameters().get('CF00N1F000002a29R_lkid'));
        cList.add(imp);
        
            
     }   
if(cList.size()>0)
{
     insert cList; 
     return new PageReference('/'+ApexPages.currentPage().getParameters().get('CF00N1F000002a29R_lkid'));
     }
     
        errormsg=true;
         return null;        
    }
       
    
       /* return error message if no contact is selected */
        public boolean geterrormsg()
        {
         return errormsg;
        } 
        
        /* Method to cancel the entire process */
        public Pagereference Cancel()
        {
        return new PageReference('/'+ApexPages.currentPage().getParameters().get('CF00N1F000002a29R_lkid'));
        }
        
    }


Test Class:-

@isTest
private class Test_ImpactedIssuerController
 {
 
    
   
  @isTest static void TestIssuer()
    {
       
       PageReference pageRef = Page.ImpactedIssuerVFpage;
       Test.setCurrentPage(pageRef); 
       String userinput;
       String userinp;
       String userinp2;
       String siloinput;             
       boolean selectAllCheckbox;
       boolean errormsg;
       selectAllCheckbox= false;
       
       Issuers__c issu= new Issuers__c();
          
          issu.Name='Name';
          issu.Bankdir_Name__c='testdir'; 
          issu.Processor_Name__c='Tsys';
          issu.Subprocessor_Name__c='IND';
          issu.Silo_Name__c='Preview2';       
          Insert issu;
          
                
            Development_Tasks__c DT = new Development_Tasks__c (
            Subject__c = 'Test DevTask Subject',
            Description__c = 'Test DevTask Description',
            Assignment_Group__c = 'Application Development',
            Request_Type__c = 'Add BIN',
            Platform__c = 'Preview 2',
            Status__c = 'Ready for Development'
            );
            insert DT;
            
            
            Impacted_Issuers__c imp= new Impacted_Issuers__c();
             imp.Name=issu.Name;
             imp.Development_Task__c=DT.ID;
             imp.Bankdir_Name__c=issu.Bankdir_Name__c; 
             imp.Processor_Name__c=issu.Processor_Name__c;
             imp.Subprocessor_Name__c=issu.Subprocessor_Name__c;
             imp.Silo_Name__c=issu.Silo_Name__c;  
             insert imp;
             
                        
             ImpactedIssuerController.WrapIssuer wp = new ImpactedIssuerController.WrapIssuer(issu);
                       
             Impacted_Issuers__c imp1= new Impacted_Issuers__c();
             imp1.Name='Imptest';
             imp1.Development_Task__c=DT.ID;
             imp1.Bankdir_Name__c='testdir'; 
             imp1.Processor_Name__c='Tsys';
             imp1.Subprocessor_Name__c='IND';
             imp1.Silo_Name__c='Preview2';  
             insert imp1;
            
           
           Test.StartTest(); 
        
            ApexPages.currentPage().getParameters().put('Id', String.valueOf(issu.Id));
            ApexPages.StandardController sc = new ApexPages.StandardController(imp);
                        
            ImpactedIssuerController obj = new ImpactedIssuerController(sc);
            List<Impacted_Issuers__c> lstimp = new List<Impacted_Issuers__c>();
            
            lstimp.add(imp); 
            System.assertEquals(true,lstimp.size()>0);
             
            obj.Cancel();
            obj.geterrormsg();
            obj.search();
            obj.getresults();            
            obj.processSelected();            
            obj.getuserinput();
            obj.getuserinp();
            obj.getuserinp2();
            obj.getsiloinput();
            obj.setuserinput(userinput);
            obj.setuserinp(userinp);
            obj.setuserinp2(userinp2);
            obj.setsiloinput(siloinput);
            

        Test.StopTest();
             
          }
           
         }
Hi Please Help Me how to write a test class for my controller.

public class ImpactedIssuerController {


public ImpactedIssuerController(ApexPages.StandardController controller){ 

 
}
   
     Public String cid;
     public List<WrapIssuer> wrapIssuerList {get; set;}
     public Boolean selectAllCheckbox {get; set;}  
     public boolean errormsg=false; 
    
     String userinput;
     String userinp;
     String userinp2;
     String siloinput;
    
     public List<Issuers__c> allissuer = new List<Issuers__c>();
     public List<Issuers__c> selectedIssuer2 = new List<Issuers__c>();
     
     
     /* Getter and setter methods for getting the user input ie. Issuer name from the UI */
     public String getuserinput(){return userinput;}
     //public void setuserinput(String userinp){this.userinput=userinp=userinp2;}
     public void setuserinput(String userinp){this.userinput=userinp;}
     public String getuserinp(){return userinp;}
     public void setuserinp(String userinp){this.userinp=userinp;} 
     
     public String getuserinp2(){return userinp2;}
     public void setuserinp2(String userinp2){this.userinp2=userinp2;} 
     
     public String getsiloinput(){return siloinput;}
     public void setsiloinput(String siloinput){this.siloinput=siloinput;}
     
     
      /*End of Getter and Setter methods */
      
      
     /* Method to Search the Issuer database to fetch the query results */
      public List<Issuers__c> search() {
      
      errormsg=false;
      wrapIssuerList = new List<WrapIssuer>();
      for(Issuers__c ilist:[select Name,id,Bankdir_Name__c,Processor_Name__c,Subprocessor_Name__c,Silo_Name__c  from Issuers__c where Name like :userinput+'%' and Processor_Name__c like :userinp+'%' and Subprocessor_Name__c like :userinp2+'%' and Silo_Name__c like :siloinput+'%'LIMIT 1000 ])
        {
           wrapIssuerList.add(new WrapIssuer(ilist));
         }
         return null;
      }
      /* End of Search method */
       
       /* Method for returning the contact search results to the UI */
        public List<WrapIssuer> getresults()
            {
             return wrapIssuerList;
            }
        /* End of Method */
        
        
        /* Wrapper class to contain contact record and a boolean flag */
        public class WrapIssuer {
        public Issuers__c Issu {get; set;}
        public Boolean selected {get; set;}
 
        public WrapIssuer(Issuers__c ism) {
            Issu = ism;
            selected = false;
         }
        }
       /* end of Wrapper class */
       
       
      /* Method to fetch the selected records and save them to other another object*/
      
   public List<Impacted_Issuers__c> cList=new List<Impacted_Issuers__c>();
    
    public PageReference processSelected() {
    List<Issuers__c> selectedIssuers = new List<Issuers__c>();
    //selectedIssuer= new List<Issuers__c>();
 
        for(wrapIssuer wrapIssuerObj : wrapIssuerList) {
            if(wrapIssuerObj.selected == true) {
                selectedIssuers.add(wrapIssuerObj.Issu);
            }
        }
    
     for(Issuers__c Issu:selectedIssuers){
     Impacted_Issuers__c imp =new Impacted_Issuers__c();
        imp.Name=Issu.name;
        imp.Bankdir_Name__c=Issu.Bankdir_Name__c;
        imp.Processor_Name__c=Issu.Processor_Name__c;
        imp.Subprocessor_Name__c=Issu.Subprocessor_Name__c;
        imp.Silo_Name__c=Issu.Silo_Name__c;
        imp.Development_Task__c =string.valueOf(apexpages.currentpage().getparameters().get('CF00N1F000002a29R_lkid'));
        cList.add(imp);
        
            
     }   
if(cList.size()>0)
{
     insert cList; 
     return new PageReference('/'+ApexPages.currentPage().getParameters().get('CF00N1F000002a29R_lkid'));
     }
     
        errormsg=true;
         return null;        
    }
       
    
       /* return error message if no contact is selected */
        public boolean geterrormsg()
        {
         return errormsg;
        } 
        
        /* Method to cancel the entire process */
        public Pagereference Cancel()
        {
        return new PageReference('/'+ApexPages.currentPage().getParameters().get('CF00N1F000002a29R_lkid'));
        }
        
    }
Hi All,

I am getting an error when doing third party REST API call. So Please help me how I will resolve this issue.

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; PKIX path building failed


Thanks in advance,
 
Hi All,

I am getting an error when fetching data from the third-party system using rest API.
Too many query rows: 50001
Error is in expression '{!saveCalloutResult}' in component <apex:commandButton> in page issuercallvfpage: Class.Database.QueryLocatorIterator.hasNext: line 41, column 1
Class.RestapiCallclass.saveCalloutResult: line 66, column 1
Class.RestapiCallclass.saveCalloutResult: line 16, column 1


My code:- 

public class RestapiCallclass {

    public void saveCalloutResult(){
        string[] urllist = new List<String>();
        urllist.add('https://preview.test1.com/ifsservice/issuer/getIssueList');
        urllist.add('https://preview.test2.com/ifsservice/issuer/getIssueList');
        urllist.add('https://preview.test3.com/ifsservice/issuer/getIssueList');
        urllist.add('https://preview.test4.com/ifsservice/issuer/getIssueList');
        urllist.add('https://preview.test5.com/ifsservice/issuer/getIssueList');
        
        for( Integer i=0; i< urllist.size(); i++ ){
        saveCalloutResult(urllist[i]);
        }
        }
     
    public void saveCalloutResult(string url){
         // Instantiate a new http object
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url);
        req.setMethod('GET');
        req.setHeader('Content-Type', 'application/json');
        req.setHeader('Accept','application/json');
         system.debug('### '+ req);    
        String username = 'username';
        String password = 'password';
        
        Blob headerValue= Blob.valueOf(username + ':' + password);
        String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
        req.setHeader('Authorization', authorizationHeader);
        
        system.debug('###req### '+ req);            
        HttpResponse res = h.send(req);
        system.debug('###res### '+ res);
        
        string response = res.getBody();
        system.debug('### '+ response);
               
        List<JsonParserDetail> responseDetails = JsonParserDetail.parse(response); 
        system.debug('### '+responseDetails);
        
        Set<String> bankNames = New Set<String>();
        // declare issuer list to inser 
        List<Issuer__c> InsertedIssuers = New List<Issuer__c>();
        // I used limit in below query, but its better to use any filter to limit the data
        for(Issuer__c issuer : [Select Id,Bankdir_Name__c from Issuer__c LIMIT 50000]){
            If(!string.isBlank(issuer.Bankdir_Name__c)){
                bankNames.add(issuer.Bankdir_Name__c);
            }
        }
        
        if(responseDetails.size() > 0){
            for(JsonParserDetail jpd : responseDetails){
                If(! bankNames.contains(jpd.issuerBankdirName)){
                    InsertedIssuers.add(getIssuer(jpd.issuername,jpd.issuerBankdirName,jpd.processorName,jpd.subProcessorName,jpd.siloName));
                }
            }
        }
        If(InsertedIssuers.size() >0){
            insert InsertedIssuers;
        }
    }
    
    public Issuer__c getIssuer(string iName, string ibName, string pName, string spName,string siloName){
        Issuer__c issuer = New Issuer__c();
        issuer.Name = iName;
        issuer.Bankdir_Name__c = ibName;
        issuer.Processor_Name__c = pName;
        issuer.SubProcessor_Name__c = spName;
        issuer.Silo_Name__c = siloName;
        return issuer;
    }
}

Visual force page:- 
<apex:page controller="RestapiCallclass " sidebar="True"> <apex:form > <apex:commandButton value="Refresh Issuer List from Server" action="{!saveCalloutResult}"/> </apex:form> </apex:page>


Please help me how I will resolve this error using the following code.
Thanks in Advance. 
In my current scenario 
I am having 4 REST API URL.
url 1.    https:// test1/a
url 2     https:// test2/b
url 3     https:// test 3/c
url 4     https:// test 4/d
 
and picklist value= test1,test2,test3,test4
I want to create a custom picklist field in the visual force page.
based on selected picklist value I want to hit related API and then that URL value I want to pass into save method.
for example, if I will select test1 value then it will refer URL 1 then once I will click on save button then need to hit url 1 and get the record from url 1.

please help me how to achieve this using visualforce page.

Thanks In advance. 
Hi, all please help me save response in a custom object.

I have written my code and able to display record in the Visualforce page from rest API endpoint.
please help me to store data in  Custom object  test__c

Wrapper class
global class Issuerwrap {
public String issuername{get;set;}
public String issuerBankdirName{get;set;}
public String ProcessorName{get;set;}
public String SubprocessorName{get;set;}
}

Controller
public class IssuerCalloutcontroller {
public List<Issuerwrap> IssuerWrapperList{get;set;}
public List<Issuerwrap> getperformcallout(){
IssuerWrapperList= new List<Issuerwrap>();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();
req.setEndpoint('https://************End-point *****************');
req.setMethod('GET');
res = http.send(req);
if(res.getstatusCode() == 200 && res.getbody() != null){
IssuerWrapperList=(List<Issuerwrap>)json.deserialize(res.getbody(),List<Issuerwrap>.class);
}
return IssuerWrapperList;
}
}

VF Page

<apex:page controller="IssuerCalloutcontroller" title="JSON table" readonly="true" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!performcallout}" var="wrap" width="100%">
<!--<apex:column headerValue="Select">
<apex:inputCheckbox value="{!wrap.isSelected}"/>
</apex:column>-->
<apex:column headerValue="Name" value="{!wrap.issuername}"/>
<apex:column headerValue="BankdirName" value="{!wrap.issuerBankdirName}"/>
<apex:column headerValue="ProcessorName" value="{!wrap.ProcessorName}"/>
<apex:column headerValue="SubprocessorName" value="{!wrap.SubprocessorName}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

it's very urgent please help me.
Thanks in advance
Hi All,

I am having one 3 object 
Note:- Account and SalesPreson__c object is not related to each other directly.
1. Account (Country__c, State__C)
2. SalesPreson__c(Country__c,State__C)
2. Opportunity( Opportunity object having Account & SalesPreson__c is lookup field)
my scenario is if the user is selecting Account and if Account country is India & State is Delhi then the second lookup field that is SalesPreson__c in this lookup search page in need to display only that Salesperson name which belongs from country India and State  Delhi.

Please, tell me how can I achieve this using trigger.
Thanks in advance.
It's very urgent.



 
Hi All,

Please help me to write a trigger to validate and send mail when validation error comes.
  1. While a user is creating Opportunity and selecting Account in the opportunity page then need to check if the Account having Country and State is same as Individual object County and state then a user can able to create opportunity else throw an error and send mail to a current user's manager.  
User-added image

Please help me how to write trigger for this seenario?

 
Hi All,
public class IssuersCalloutController {

    public IssuersCalloutController(ApexPages.StandardController controller) {

        }    
            
    public PageReference callhttp(string serviceURL)
        {
            System.debug('mytest method');
            Http h = new Http();
            HttpRequest req = new HttpRequest();
            req.setEndpoint(serviceURL);
            req.setMethod('GET');
            req.setHeader('Content-Type', 'application/json');
            req.setHeader('Accept','application/json');
            system.debug('request endpoint '+ req);    
            String username = 'amit';
            String password = 'Password';
        
            Blob headerValue= Blob.valueOf(username + ':' + password);
            system.debug('headerValue'+ headerValue);
            String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
            req.setHeader('Authorization', authorizationHeader);
            req.setTimeout(60000);
        
            system.debug('###req### '+ req);            
            HttpResponse res = h.send(req);
            system.debug('###res### '+ res);
        
            string response = res.getBody();
            system.debug('response'+ response);
               
                
            Set<String> bankNames = New Set<String>();
            // declare issuer list to insert 
            List<Issuers__c> InsertedIssuers = New List<Issuers__c>();
            for(Issuers__c issuer : [Select Id,Bankdir_Name__c from Issuers__c LIMIT 50000]){
            If(!string.isBlank(issuer.Bankdir_Name__c))
                {
                bankNames.add(issuer.Bankdir_Name__c);                          
                }
            }
            system.debug('###Bank Name### '+ bankNames.size());
            List<JsonParserDetail> responseDetails = JsonParserDetail.parse(response); 
            system.debug('****responseDetails****** '+responseDetails);
        
            if(responseDetails.size() > 0){
            for(JsonParserDetail jpd : responseDetails){
                If(!bankNames.contains(jpd.issuerBankdirName))
                    {
                        InsertedIssuers.add(getIssuer(jpd.issuername,jpd.issuerBankdirName,jpd.processorName,jpd.subProcessorName,jpd.siloName));
                    }
                }
            }
            If(InsertedIssuers.size() >0){
            insert InsertedIssuers;      
            }
            PageReference p = apexPages.currentPage();
            string siloName = getsiloname(serviceUrl);
            string message=siloName+' list Successfully updated'+ (InsertedIssuers.size())+'"Thank you!';
            ApexPages.Message msg=new ApexPages.Message(ApexPages.Severity.CONFIRM,message);
            ApexPages.addMessage(msg);
            return p;
        }
 
 
    public string getsiloname(string url) {
            if(url.contains(‘test1’)) {
                return ‘test1';
                }   
            else if(url.contains('test2')) {
                return 'test2';
                }
            else if(url.contains(‘test3’)) {
                return ‘test3';
                }
            else if(url.contains(‘test4’)) {
                return ‘test4';
                }
            else if(url.contains('test5')) {
                return 'test5';
                }
            else if(url.contains('test6')) {
                return 'test6';
                }
                else {                
                return '';
                }
            }

    public PageReference savePreview2Result(){
        PageReference p = callhttp('https://test1/getIssueList' )
            return p;
        }
    
    public PageReference savePreview4Result(){
        PageReference p = callhttp('https://test2/getIssueList' ); 
            return p;
        }
    
    public PageReference savePreview5Result(){
        PageReference p = callhttp('https://test3/getIssueList' ); 
            return p;
        }
    
    public PageReference savePreview7Result(){
        PageReference p = callhttp('https://test4/getIssueList' ); 
            return p;
        }
    public PageReference saveTsysResult(){
       PageReference p = callhttp('https://test5/getIssueList' ); 
            return p;
        }
       
    public PageReference saveMyscResult(){
        PageReference p = callhttp('https://test6/getIssueList' ); 
            return p;
        }
  
          
    public Issuers__c getIssuer(string iName, string ibName, string pName, string spName,string siloName){
    
            Issuers__c issuer = New Issuers__c();
            issuer.Name = iName;
            issuer.Bankdir_Name__c = ibName;
            issuer.Processor_Name__c = pName;
            issuer.SubProcessor_Name__c = spName;
            issuer.Silo_Name__c = siloName;
            return issuer;
        }
    }



My test class 1:-
@isTest
global class MockHttpResponseGenerator implements HttpCalloutMock {

        global HTTPResponse respond(HTTPRequest req) {               
        System.assertEquals('https://test2/getIssueList', req.getEndpoint());                  
        HttpResponse res = new HttpResponse();
        String body = strBody;
        res.setHeader('Content-Type', 'application/json');
        res.setBody(body);
        res.setStatusCode(200);
        return res;
    }
    
     public static final string strBody = '{'+       
        '           "processorName": "PSCUFFFS",'+
        '           "siloName": "Preview",'+
        '           "issuername": "Trumark ", '+
        '           "issuerBankdirName": "4735", '+
        '           "subProcessorName": "PSAgCU"'+
        '}'; 
}
Test Class 2:-
@isTest
private class IssuersCalloutController_Test{
     @isTest static void testCallout() {
     
    PageReference pageRef = Page.ImpactedIssuerVFpage;
    Test.setCurrentPage(pageRef);

    Issuers__c issuer = New Issuers__c();
        issuer.Name = 'Test'; 
        issuer.Bankdir_Name__c =  'Test'; 
        issuer.Processor_Name__c = 'Test'; 
        issuer.SubProcessor_Name__c = 'Test'; 
        issuer.Silo_Name__c =  'Test'; 
        insert issuer ;
            
        Test.StartTest(); 
        ApexPages.currentPage().getParameters().put('Id', String.valueOf(issuer.Id));
        ApexPages.StandardController sc = new ApexPages.StandardController(issuer);        
        IssuersCalloutController ic = new IssuersCalloutController(sc);
        Test.setMock(HttpCalloutMock.class, new MockHttpResponseGenerator());        
        ic.getsiloname('URL');           
        ic.savePreview2Result();     
        ic.getIssuer('Test1', 'Test2', 'Test3', 'Test4','Test5');
        Test.StopTest(); 
         }
    }

Please help me it's urgent
Hi All,
Please check my code I am getting 71%code coverage. please help me.
My Controller:-
public class ImpactedIssuerController {


public ImpactedIssuerController(ApexPages.StandardController controller){ 

 
}
   
     Public String cid;
     public List<WrapIssuer> wrapIssuerList {get; set;}
     public Boolean selectAllCheckbox {get; set;}  
     public boolean errormsg=false; 
    
     String userinput;
     String userinp;
     String userinp2;
     String siloinput;
    
     public List<Issuers__c> allissuer = new List<Issuers__c>();
     public List<Issuers__c> selectedIssuer2 = new List<Issuers__c>();
     
     
     /* Getter and setter methods for getting the user input ie. Issuer name from the UI */
     public String getuserinput(){return userinput;}
     //public void setuserinput(String userinp){this.userinput=userinp=userinp2;}
     public void setuserinput(String userinp){this.userinput=userinp;}
     public String getuserinp(){return userinp;}
     public void setuserinp(String userinp){this.userinp=userinp;} 
     
     public String getuserinp2(){return userinp2;}
     public void setuserinp2(String userinp2){this.userinp2=userinp2;} 
     
     public String getsiloinput(){return siloinput;}
     public void setsiloinput(String siloinput){this.siloinput=siloinput;}
     
     
      /*End of Getter and Setter methods */
      
      
     /* Method to Search the Issuer database to fetch the query results */
      public List<Issuers__c> search() {
      
      errormsg=false;
      wrapIssuerList = new List<WrapIssuer>();
      for(Issuers__c ilist:[select Name,id,Bankdir_Name__c,Processor_Name__c,Subprocessor_Name__c,Silo_Name__c  from Issuers__c where Name like :userinput+'%' and Processor_Name__c like :userinp+'%' and Subprocessor_Name__c like :userinp2+'%' and Silo_Name__c like :siloinput+'%'LIMIT 1000 ])
        {
           wrapIssuerList.add(new WrapIssuer(ilist));
         }
         return null;
      }
      /* End of Search method */
       
       /* Method for returning the contact search results to the UI */
        public List<WrapIssuer> getresults()
            {
             return wrapIssuerList;
            }
        /* End of Method */
        
        
        /* Wrapper class to contain contact record and a boolean flag */
        public class WrapIssuer {
        public Issuers__c Issu {get; set;}
        public Boolean selected {get; set;}
 
        public WrapIssuer(Issuers__c ism) {
            Issu = ism;
            selected = false;
         }
        }
       /* end of Wrapper class */
       
       
      /* Method to fetch the selected records and save them to other other object */
      
   public List<Impacted_Issuers__c> cList=new List<Impacted_Issuers__c>();
    
    public PageReference processSelected() {
    List<Issuers__c> selectedIssuers = new List<Issuers__c>();
    //selectedIssuer= new List<Issuers__c>();
 
        for(wrapIssuer wrapIssuerObj : wrapIssuerList) {
            if(wrapIssuerObj.selected == true) {
                selectedIssuers.add(wrapIssuerObj.Issu);
            }
        }
    
     for(Issuers__c Issu:selectedIssuers){
     Impacted_Issuers__c imp =new Impacted_Issuers__c();
        imp.Name=Issu.name;
        imp.Bankdir_Name__c=Issu.Bankdir_Name__c;
        imp.Processor_Name__c=Issu.Processor_Name__c;
        imp.Subprocessor_Name__c=Issu.Subprocessor_Name__c;
        imp.Silo_Name__c=Issu.Silo_Name__c;
        imp.Development_Task__c =string.valueOf(apexpages.currentpage().getparameters().get('CF00N1F000002a29R_lkid'));
        cList.add(imp);
        
            
     }   
if(cList.size()>0)
{
     insert cList; 
     return new PageReference('/'+ApexPages.currentPage().getParameters().get('CF00N1F000002a29R_lkid'));
     }
     
        errormsg=true;
         return null;        
    }
       
    
       /* return error message if no contact is selected */
        public boolean geterrormsg()
        {
         return errormsg;
        } 
        
        /* Method to cancel the entire process */
        public Pagereference Cancel()
        {
        return new PageReference('/'+ApexPages.currentPage().getParameters().get('CF00N1F000002a29R_lkid'));
        }
        
    }


Test Class:-

@isTest
private class Test_ImpactedIssuerController
 {
 
    
   
  @isTest static void TestIssuer()
    {
       
       PageReference pageRef = Page.ImpactedIssuerVFpage;
       Test.setCurrentPage(pageRef); 
       String userinput;
       String userinp;
       String userinp2;
       String siloinput;             
       boolean selectAllCheckbox;
       boolean errormsg;
       selectAllCheckbox= false;
       
       Issuers__c issu= new Issuers__c();
          
          issu.Name='Name';
          issu.Bankdir_Name__c='testdir'; 
          issu.Processor_Name__c='Tsys';
          issu.Subprocessor_Name__c='IND';
          issu.Silo_Name__c='Preview2';       
          Insert issu;
          
                
            Development_Tasks__c DT = new Development_Tasks__c (
            Subject__c = 'Test DevTask Subject',
            Description__c = 'Test DevTask Description',
            Assignment_Group__c = 'Application Development',
            Request_Type__c = 'Add BIN',
            Platform__c = 'Preview 2',
            Status__c = 'Ready for Development'
            );
            insert DT;
            
            
            Impacted_Issuers__c imp= new Impacted_Issuers__c();
             imp.Name=issu.Name;
             imp.Development_Task__c=DT.ID;
             imp.Bankdir_Name__c=issu.Bankdir_Name__c; 
             imp.Processor_Name__c=issu.Processor_Name__c;
             imp.Subprocessor_Name__c=issu.Subprocessor_Name__c;
             imp.Silo_Name__c=issu.Silo_Name__c;  
             insert imp;
             
                        
             ImpactedIssuerController.WrapIssuer wp = new ImpactedIssuerController.WrapIssuer(issu);
                       
             Impacted_Issuers__c imp1= new Impacted_Issuers__c();
             imp1.Name='Imptest';
             imp1.Development_Task__c=DT.ID;
             imp1.Bankdir_Name__c='testdir'; 
             imp1.Processor_Name__c='Tsys';
             imp1.Subprocessor_Name__c='IND';
             imp1.Silo_Name__c='Preview2';  
             insert imp1;
            
           
           Test.StartTest(); 
        
            ApexPages.currentPage().getParameters().put('Id', String.valueOf(issu.Id));
            ApexPages.StandardController sc = new ApexPages.StandardController(imp);
                        
            ImpactedIssuerController obj = new ImpactedIssuerController(sc);
            List<Impacted_Issuers__c> lstimp = new List<Impacted_Issuers__c>();
            
            lstimp.add(imp); 
            System.assertEquals(true,lstimp.size()>0);
             
            obj.Cancel();
            obj.geterrormsg();
            obj.search();
            obj.getresults();            
            obj.processSelected();            
            obj.getuserinput();
            obj.getuserinp();
            obj.getuserinp2();
            obj.getsiloinput();
            obj.setuserinput(userinput);
            obj.setuserinp(userinp);
            obj.setuserinp2(userinp2);
            obj.setsiloinput(siloinput);
            

        Test.StopTest();
             
          }
           
         }
Hi Please Help Me how to write a test class for my controller.

public class ImpactedIssuerController {


public ImpactedIssuerController(ApexPages.StandardController controller){ 

 
}
   
     Public String cid;
     public List<WrapIssuer> wrapIssuerList {get; set;}
     public Boolean selectAllCheckbox {get; set;}  
     public boolean errormsg=false; 
    
     String userinput;
     String userinp;
     String userinp2;
     String siloinput;
    
     public List<Issuers__c> allissuer = new List<Issuers__c>();
     public List<Issuers__c> selectedIssuer2 = new List<Issuers__c>();
     
     
     /* Getter and setter methods for getting the user input ie. Issuer name from the UI */
     public String getuserinput(){return userinput;}
     //public void setuserinput(String userinp){this.userinput=userinp=userinp2;}
     public void setuserinput(String userinp){this.userinput=userinp;}
     public String getuserinp(){return userinp;}
     public void setuserinp(String userinp){this.userinp=userinp;} 
     
     public String getuserinp2(){return userinp2;}
     public void setuserinp2(String userinp2){this.userinp2=userinp2;} 
     
     public String getsiloinput(){return siloinput;}
     public void setsiloinput(String siloinput){this.siloinput=siloinput;}
     
     
      /*End of Getter and Setter methods */
      
      
     /* Method to Search the Issuer database to fetch the query results */
      public List<Issuers__c> search() {
      
      errormsg=false;
      wrapIssuerList = new List<WrapIssuer>();
      for(Issuers__c ilist:[select Name,id,Bankdir_Name__c,Processor_Name__c,Subprocessor_Name__c,Silo_Name__c  from Issuers__c where Name like :userinput+'%' and Processor_Name__c like :userinp+'%' and Subprocessor_Name__c like :userinp2+'%' and Silo_Name__c like :siloinput+'%'LIMIT 1000 ])
        {
           wrapIssuerList.add(new WrapIssuer(ilist));
         }
         return null;
      }
      /* End of Search method */
       
       /* Method for returning the contact search results to the UI */
        public List<WrapIssuer> getresults()
            {
             return wrapIssuerList;
            }
        /* End of Method */
        
        
        /* Wrapper class to contain contact record and a boolean flag */
        public class WrapIssuer {
        public Issuers__c Issu {get; set;}
        public Boolean selected {get; set;}
 
        public WrapIssuer(Issuers__c ism) {
            Issu = ism;
            selected = false;
         }
        }
       /* end of Wrapper class */
       
       
      /* Method to fetch the selected records and save them to other another object*/
      
   public List<Impacted_Issuers__c> cList=new List<Impacted_Issuers__c>();
    
    public PageReference processSelected() {
    List<Issuers__c> selectedIssuers = new List<Issuers__c>();
    //selectedIssuer= new List<Issuers__c>();
 
        for(wrapIssuer wrapIssuerObj : wrapIssuerList) {
            if(wrapIssuerObj.selected == true) {
                selectedIssuers.add(wrapIssuerObj.Issu);
            }
        }
    
     for(Issuers__c Issu:selectedIssuers){
     Impacted_Issuers__c imp =new Impacted_Issuers__c();
        imp.Name=Issu.name;
        imp.Bankdir_Name__c=Issu.Bankdir_Name__c;
        imp.Processor_Name__c=Issu.Processor_Name__c;
        imp.Subprocessor_Name__c=Issu.Subprocessor_Name__c;
        imp.Silo_Name__c=Issu.Silo_Name__c;
        imp.Development_Task__c =string.valueOf(apexpages.currentpage().getparameters().get('CF00N1F000002a29R_lkid'));
        cList.add(imp);
        
            
     }   
if(cList.size()>0)
{
     insert cList; 
     return new PageReference('/'+ApexPages.currentPage().getParameters().get('CF00N1F000002a29R_lkid'));
     }
     
        errormsg=true;
         return null;        
    }
       
    
       /* return error message if no contact is selected */
        public boolean geterrormsg()
        {
         return errormsg;
        } 
        
        /* Method to cancel the entire process */
        public Pagereference Cancel()
        {
        return new PageReference('/'+ApexPages.currentPage().getParameters().get('CF00N1F000002a29R_lkid'));
        }
        
    }
Hi All,

I am getting an error when fetching data from the third-party system using rest API.
Too many query rows: 50001
Error is in expression '{!saveCalloutResult}' in component <apex:commandButton> in page issuercallvfpage: Class.Database.QueryLocatorIterator.hasNext: line 41, column 1
Class.RestapiCallclass.saveCalloutResult: line 66, column 1
Class.RestapiCallclass.saveCalloutResult: line 16, column 1


My code:- 

public class RestapiCallclass {

    public void saveCalloutResult(){
        string[] urllist = new List<String>();
        urllist.add('https://preview.test1.com/ifsservice/issuer/getIssueList');
        urllist.add('https://preview.test2.com/ifsservice/issuer/getIssueList');
        urllist.add('https://preview.test3.com/ifsservice/issuer/getIssueList');
        urllist.add('https://preview.test4.com/ifsservice/issuer/getIssueList');
        urllist.add('https://preview.test5.com/ifsservice/issuer/getIssueList');
        
        for( Integer i=0; i< urllist.size(); i++ ){
        saveCalloutResult(urllist[i]);
        }
        }
     
    public void saveCalloutResult(string url){
         // Instantiate a new http object
        Http h = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint(url);
        req.setMethod('GET');
        req.setHeader('Content-Type', 'application/json');
        req.setHeader('Accept','application/json');
         system.debug('### '+ req);    
        String username = 'username';
        String password = 'password';
        
        Blob headerValue= Blob.valueOf(username + ':' + password);
        String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
        req.setHeader('Authorization', authorizationHeader);
        
        system.debug('###req### '+ req);            
        HttpResponse res = h.send(req);
        system.debug('###res### '+ res);
        
        string response = res.getBody();
        system.debug('### '+ response);
               
        List<JsonParserDetail> responseDetails = JsonParserDetail.parse(response); 
        system.debug('### '+responseDetails);
        
        Set<String> bankNames = New Set<String>();
        // declare issuer list to inser 
        List<Issuer__c> InsertedIssuers = New List<Issuer__c>();
        // I used limit in below query, but its better to use any filter to limit the data
        for(Issuer__c issuer : [Select Id,Bankdir_Name__c from Issuer__c LIMIT 50000]){
            If(!string.isBlank(issuer.Bankdir_Name__c)){
                bankNames.add(issuer.Bankdir_Name__c);
            }
        }
        
        if(responseDetails.size() > 0){
            for(JsonParserDetail jpd : responseDetails){
                If(! bankNames.contains(jpd.issuerBankdirName)){
                    InsertedIssuers.add(getIssuer(jpd.issuername,jpd.issuerBankdirName,jpd.processorName,jpd.subProcessorName,jpd.siloName));
                }
            }
        }
        If(InsertedIssuers.size() >0){
            insert InsertedIssuers;
        }
    }
    
    public Issuer__c getIssuer(string iName, string ibName, string pName, string spName,string siloName){
        Issuer__c issuer = New Issuer__c();
        issuer.Name = iName;
        issuer.Bankdir_Name__c = ibName;
        issuer.Processor_Name__c = pName;
        issuer.SubProcessor_Name__c = spName;
        issuer.Silo_Name__c = siloName;
        return issuer;
    }
}

Visual force page:- 
<apex:page controller="RestapiCallclass " sidebar="True"> <apex:form > <apex:commandButton value="Refresh Issuer List from Server" action="{!saveCalloutResult}"/> </apex:form> </apex:page>


Please help me how I will resolve this error using the following code.
Thanks in Advance. 
Hi, all please help me save response in a custom object.

I have written my code and able to display record in the Visualforce page from rest API endpoint.
please help me to store data in  Custom object  test__c

Wrapper class
global class Issuerwrap {
public String issuername{get;set;}
public String issuerBankdirName{get;set;}
public String ProcessorName{get;set;}
public String SubprocessorName{get;set;}
}

Controller
public class IssuerCalloutcontroller {
public List<Issuerwrap> IssuerWrapperList{get;set;}
public List<Issuerwrap> getperformcallout(){
IssuerWrapperList= new List<Issuerwrap>();
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();
req.setEndpoint('https://************End-point *****************');
req.setMethod('GET');
res = http.send(req);
if(res.getstatusCode() == 200 && res.getbody() != null){
IssuerWrapperList=(List<Issuerwrap>)json.deserialize(res.getbody(),List<Issuerwrap>.class);
}
return IssuerWrapperList;
}
}

VF Page

<apex:page controller="IssuerCalloutcontroller" title="JSON table" readonly="true" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!performcallout}" var="wrap" width="100%">
<!--<apex:column headerValue="Select">
<apex:inputCheckbox value="{!wrap.isSelected}"/>
</apex:column>-->
<apex:column headerValue="Name" value="{!wrap.issuername}"/>
<apex:column headerValue="BankdirName" value="{!wrap.issuerBankdirName}"/>
<apex:column headerValue="ProcessorName" value="{!wrap.ProcessorName}"/>
<apex:column headerValue="SubprocessorName" value="{!wrap.SubprocessorName}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

it's very urgent please help me.
Thanks in advance