function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kmorf_entransformkmorf_entransform 

Error in production!

Hi im getting this visualforce error in production that says "Argument 1 cannot be null". but it is not specifying where the error is happening. here is the constructor for the controller being used in this page.

 public myAucions(){
    {
        SHOW_SUMMARY_TABLE = false;
        SHOW_LISTING_TABLE = true;
        SHOW_SUMMARY_DETAIL = false;
        SHOW_SUCCESS_MSG = false;   
        SHOW_COMMIT_BUTTON = false;
        
       
            
        try
        {
           // this.category= (ServoTerraCategory__c) controller.getRecord(); 
            Profile vProfile = [Select p.Id, p.Name from Profile p where p.Id=:UserInfo.getProfileId()];
            if(vProfile!=null && vProfile.name.startsWith('Public'))
            {
                showHeader='false';
                siteTemplate='SiteTemplate';
            }
            else
            {
                showHeader='true';
                siteTemplate='PortalTemplate';
            }
            
            
         }
          catch(exception e){
          	
          }
          
         
       
        if(ApexPages.currentPage().getParameters().get('assetid') != null)
        {
            AssetId = ApexPages.currentPage().getParameters().get('assetid');
            makeOfferBtnActn();
        }
       
      
    }//end of constructor

 

public class InnerClassForOfferVals
    {
        public auction__c objAuctn {get;set;}
        public Double offerAmt {get;set;}
        public Double totalAmt {get;set;}
        public String buyerComments {get;set;}
        public InnerClassForOfferVals(){}
    }
    
    public List<InnerClassForOfferVals> lstSummaryAuction {get; set;}
    
    public void makeOfferBtnActn()
    {
        lstSummaryAuction = new List<InnerClassForOfferVals>();
        if(AssetId == null)
        {    
            try{  
            for(Integer i=0; i<pager.pages.size(); i++)
            {
                List<AuctionRecord> lstTempAuctnRec = pager.pages.get(i);
                for(AuctionRecord objAR : lstTempAuctnRec)
                {
                    if(objAR.isCheck)
                    {
                        InnerClassForOfferVals objInner = new InnerClassForOfferVals();
                        objInner.offerAmt = 0;
                        objInner.totalAmt = 0;
                        objInner.objAuctn = objAR.objAuction;
                        lstSummaryAuction.add(objInner);
                    }
                }
                
               
            }
            
            }
            catch (Exception e) {
            
            }
        }
        else
        {
            String vQuery= 'Select a.OwnerId,a.asset__c, a.Available_Date__c, a.Description__c, a.Terms__C, ' +
                                   'a.end_Date__c, a.Id, a.Location__c, a.Location__r.city__c, a.Location__r.country__c, '+
                                   'a.Location__r.state_Province__c, a.Manufacturer__c, a.Model_No__c, a.Name, a.QtyAvail__c, '+
                                   'a.Servo_Terra_Category__c, a.Servo_Terra_Category__r.Id, a.Servo_Terra_Category__r.Name, a.SRP__c, '+
                                   'a.start_Date__c from auction__c a where Id =: AssetId';
            auctionList =  Database.query(vQuery);
          
            
            InnerClassForOfferVals objInner = new InnerClassForOfferVals();
            objInner.offerAmt = 0;
            objInner.totalAmt = 0;
            objInner.objAuctn = auctionList[0];
            lstSummaryAuction.add(objInner);
        }
        if(!lstSummaryAuction.isEmpty())
        {
            SHOW_SUMMARY_TABLE = true;
            SHOW_LISTING_TABLE = false;
        }
       
    }

 

sfdcfoxsfdcfox

That error usually means you have a problem in the Visualforce code, not Apex Code. Most likely, some variable not being set is then fed into a Visualforce tag, thus causing the error message. Try opening the Debug Window and see if it will produce an error there. If so, it's a controller problem, if not, then it's (most likely) a Visualforce problem.

Ispita_NavatarIspita_Navatar

Hi kmorf_entransform,

             First of all you will have to check the records in production on which the code implemented by you generated the error, may be you did not provide the field values or they had null values. It may be the case that you have not implemented any null checks for the same hence the error are being generated.

To verify it do open the debug log window and run your VF page in which you are getting this error "Argument 1 can not be null", this help you in identifying the cause of concern.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.