• Pavan Kumar 1141
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 0
    Replies
Hi All, Need Help on code coverage for below apex class. Getting List has no rows to assign to sobject. Any help would be great. Thank you.

Here is my apex code

public class Instructions {
    public Account acc{set;get;}
    public BGBK__Return__c annualReport{get;set;}
    public Instructions(){
        acc = [select id,Business_Type__c from Account where Id=: ApexPages.currentPage().getParameters().get('entity')];
        annualReport = [Select Id,Read_Instructions__c from BGBK__Return__c where Account__c =: ApexPages.currentPage().getParameters().get('entity') Order by CreatedDate DESC limit 1];
    }
    
    public PageReference goBack()
    {        
        annualReportSubmissionLinks ARSL = new annualReportSubmissionLinks();
        Account arslAccount = ARSL.getAccount();  
       
        if(arslAccount.Business_type__c == ViewAccount.FINANCIAL_INSTITUTION || arslAccount.Business_type__c == ViewAccount.INSURANCE){
            PageReference pr = new PageReference('/apex/annualreportsubmissionlinks?entity='+ ApexPages.currentPage().getParameters().get('entity'));
            return pr;
        }else{
            PageReference pr = new PageReference('/apex/annualreportsubmissionlinks?entity='+ ApexPages.currentPage().getParameters().get('entity')+'&licenseId='+ApexPages.currentPage().getParameters().get('licenseId'));
            return pr;
        }
        
    }
    
    public PageReference confirm()
    {        
        annualReportSubmissionLinks ARSL = new annualReportSubmissionLinks();
        List<BGBK__Return__c> annualReports = ARSL.getAnnualReports(); 
        Account arslAccount = ARSL.getAccount();       
        List<MUSW__License2__c> licensesList = ARSL.getLicenses();
        
        if(arslAccount.Business_type__c == ViewAccount.FINANCIAL_INSTITUTION || arslAccount.Business_type__c == ViewAccount.INSURANCE){          
            annualReports[0].Read_Instructions__c = annualReport.Read_Instructions__c;
            annualReports[0].Submission_Status__c = UploadCSV2.SUBMISSION_PROGRESS;
            update annualReports[0];
            PageReference pr = new PageReference('/apex/annualreportsubmissionlinks?entity='+ ApexPages.currentPage().getParameters().get('entity'));
            return pr;
        }else{             
            annualReports[0].Read_Instructions__c = annualReport.Read_Instructions__c;
            annualReports[0].Submission_Status__c = UploadCSV2.SUBMISSION_PROGRESS;
            update annualReports[0];
            PageReference pr = new PageReference('/apex/annualreportsubmissionlinks?entity='+ ApexPages.currentPage().getParameters().get('entity')+'&licenseId='+ApexPages.currentPage().getParameters().get('licenseId'));
            return pr;
        }
        //if(accList.size()>0 && licensesList.size()>0)
    }
}
Hi Everyone,
                    Can anyone help me out that how to write formula in auto launched flows.
For this formula,
AND(
OR(
AND(
NOT( ISBLANK( [Opportunity].eSignature_Sent__c )),
ISBLANK( [Opportunity].wSignature_Sent__c )),
AND(
NOT( ISBLANK( [Opportunity].wSignature_Sent__c )),
ISBLANK( [Opportunity].eSignature_Sent__c ))
),
ISBLANK([Opportunity].eSignature_Completed__c ),
ISBLANK([Opportunity].wSignature_Completed__c ))

I'm getting below error 
"EnvelopeSentFormula (Formula) - The formula expression is invalid: Syntax error. Missing '='"
Hi Everyone,
                    Can anyone help me out that how to write formula in auto launched flows.
Hi Team,
                 I am Looking to Merge 2 or More PDF's into Single PDF Using Apex. Is it Possible to Merge two PDF's. Please Help me on That.

Thank you.
Hi Team, Please help me on how to create a user when a contact is created using trigger.
Hi all,I have Credit balance(Ex:10,000) and based on my expenses spent(Ex:1.Shoping 200,2.Grossery 400, etc...) the result i want is we have to subtract all the expenses from credit amount and display remaining balance using apex and vf pages
Hi all,Can any one help me in building login form using aura component
Hi All,
         Can anyone help me to get the below output using VF and Apex classes.Out put format

Thank You.
Hi,I have a small query that,I had performed arthematic operations using VF and Apex and displaying results.Now my scenario is i have to display that performed operations in below table format.Like if i enter first number 10 and second number 15 and click add it should dispaly result 25 and the resultant 10+15=25 should be stored in below table.