You need to sign in to do that
Don't have an account?

How to override 135KB limit in Visual force page:urgent
Hi Guys
I am facing one standard limitation issue long time.i have created a page for file uploading which is working fine for me,but problem is when i am uploading more 135 KB file its showing 135KB exceed limitation.I have go through some blogspot and finaly used Transient key word but its showing same.....How to achieve this issue any idea....
I am facing one standard limitation issue long time.i have created a page for file uploading which is working fine for me,but problem is when i am uploading more 135 KB file its showing 135KB exceed limitation.I have go through some blogspot and finaly used Transient key word but its showing same.....How to achieve this issue any idea....
public class NewSalesConfirmationExtension { public Purchase_Order__c purchaseOrder{get;set;} public Attachment attachment {get;set;} public boolean showC1RecordType {get;set;} public boolean showC2RecordType {get;set;} private Id c1RecordTypeId; private Id c2RecordTypeId; public NewSalesConfirmationExtension(ApexPages.StandardController controller) { c1RecordTypeId = Schema.SObjectType.Purchase_Order__c.getRecordTypeInfosByName().get('C1').getRecordTypeId(); c2RecordTypeId = Schema.SObjectType.Purchase_Order__c.getRecordTypeInfosByName().get('C2').getRecordTypeId(); purchaseOrder = new Purchase_Order__c(); purchaseOrder = (Purchase_Order__c)controller.getRecord(); String isButtonClicked = Apexpages.currentPage().getParameters().get('setDefaultValues'); if(isButtonClicked == 'true'){ setDefaultValues(); } showC1RecordType = false; showC2RecordType = false; attachment = new Attachment(); if(purchaseOrder.RecordTypeId == c1RecordTypeId){ showC1RecordType = true; showC2RecordType = false; } else if(purchaseOrder.RecordTypeId == c2RecordTypeId){ showC1RecordType = false; showC2RecordType = true; } } public void setDefaultValues(){ String quoteId = Apexpages.currentPage().getParameters().get('quoteId'); Quote__c quote = [Select o.id, o.name, o.Quantity_formula__c, o.Opportunity_Product_Detail__r.Opportunity__c, o.Opportunity__c, o.Record_type_name__c,o.Company_Name__c,Opportunity_Product_Detail__r.Opportunity__r.Account__c from Quote__c o WHERE O.id=:quoteId]; //system.assert(false,quote); purchaseOrder.Opportunity__c = quote.Opportunity_Product_Detail__r.Opportunity__c; purchaseOrder.Quote__c = quote.id; purchaseOrder.Company__c = quote.Opportunity_Product_Detail__r.Opportunity__r.Account__c; if(quote.Record_type_name__c == 'C1'){ purchaseOrder.RecordTypeId = c1RecordTypeId; } else { purchaseOrder.RecordTypeId = c2RecordTypeId; } } public PageReference save(){ if(attachment.Body == null){ Apexpages.addMessage(new Apexpages.Message(Apexpages.Severity.ERROR, 'Please upload recent Purchase Order before saving the record')); return null; } else{ try{ insert purchaseOrder; attachment.OwnerId = UserInfo.getUserId(); attachment.ParentId = purchaseOrder.id; insert attachment; return new PageReference('/'+purchaseOrder.id); } catch(DMLException e){ ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,e.getMessage())); return null; } } } }
http://sfdcsrini.blogspot.com/2014/06/what-is-maximum-view-state-size-limit.html