• Ramesh Rage
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
Hello Everyone...!

We are building a Customer Portal with force.com sites with customized login and home pages. We have a requiremnet that portal should allow at least 150 concurrent users logins at a time. Does this login limit can be controlled through coding or will salesforce takes care in the background. If salesforce takes care in the background are there any limits and if not can we controll this customly though apex coding??

Please help me ...thank you in advance.
 
Hi Friends,

Could you please share your ideas for my requiremnet..!!

How to receive or get the PDF documnet files from the external system to Salesforce from FTP location ?
Am not sure how to fetch those PDF docs placed in FTP location to Salesforce? How can we read the PDF file ?

Please share ur ideas or if you have any artcles.

Regards,
Ramesh
Hi ,

we are Getting Apex CPU time limit exceeded error while looping thte large no of records.
According to our requirement we receive large file from webmethods(the file may contains 50,000 records) then need to inset arround all records through integration code.

while looping all the records getting below error.

12:43:33.539 (20539843589)|EXCEPTION_THROWN|[509]|System.LimitException: Apex CPU time limit exceeded
12:43:33.539 (20539876910)|SYSTEM_MODE_EXIT|false
12:43:33.539 (20539934252)|FATAL_ERROR|System.LimitException: Apex CPU time limit exceeded

Class.Arqiva_IntegrationUpdates3up.cartonUnitsToInsert: line 509, column 1
Class.Arqiva_IntegrationUpdates3up.ASNAckUpdate: line 303, column 1
AnonymousBlock: line 145, column 1
AnonymousBlock: line 145, column 1
12:43:33.808 (20540012301)|CUMULATIVE_LIMIT_USAGE
12:43:33.808|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 5 out of 100
  Number of query rows: 8 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 3 out of 150
  Number of DML rows: 391 out of 10000
  Maximum CPU time: 15042 out of 10000 ******* CLOSE TO LIMIT

anyone please help on thisissue.

Regards,
Naveen

 
Need a SOQL query to get the records with its attachmnets alone, don't need records with out attachmnets.
Hi Friends,

I have a Custom VF page report where i need to display Custom Object Record along with its Attachmnets. So i went for wrapper class to display all the details in single record, As the number of records are more(more than 3000), i went for pagination using Standard Setcontroller. Pagination is not working, not sure what is the issue, can any one tell me what wrong i did in my code or any suggestions to achive pagination for my requiremnet is appeciated.

Below is my code:

public class AgreemnetsAttachmnetsController1 {

  transient public list<Apttus__APTS_Agreement__c> agreementsList {get; set;}
  transient public List<AgreemnetsWrapper> wrapperlist{get;set;}
  transient public list<Attachment> attchmentsList{get; set;}
  transient public map<id,string> agreementMap {get;set;}
  transient public list<user> username{get;set;}


  // Pagination Variables
  //public Integer pageSize {get; set;}
  //public Integer pageNumber {get; set;}
  //public Integer offset {get; set;}
  //public integer noOfRecords {get; set;}
  transient Public Apexpages.StandardSetController con {get; set;}
  transient Public Integer size{get; set;}
  transient Public Integer totalRecords{get; set;}
  transient static final String s = '012a0000000ATI9AAO';
  transient static final String s1= 'Cancelled';

  Public AgreemnetsAttachmnetsController1 (){
    
      pageNumber = 0;
      Size = 1000;
      getAgreemnetswithAttachments();
  }

  Public list<Apttus__APTS_Agreement__c> agreements
     {
       get
        {
          If(con != null){
              agreements = (list<Apttus__APTS_Agreement__c>)con.getRecords();
              return agreements ;
           }Else{
              agreements = null;
              return null;
           }
        }
        set;
     }

  Public Void getAgreemnetswithAttachments(){
      wrapperlist = New List<AgreemnetsWrapper>();

      String baseQuery ='select id,Apttus__FF_Agreement_Number__c,name,Apttus__Status_Category__c,Account_Agreement_Text__c,RecordType.Name,Apttus_Approval__Approval_Status__c,CreatedDate,Owner.FirstName,Owner.LastName,Apttus__Contract_Start_Date__c,Apttus__Contract_End_Date__c,Apttus__Perpetual__c FROM Apttus__APTS_Agreement__c where RecordTypeId=:s and  Apttus__Status_Category__c != :s1';
      con = New Apexpages.StandardSetController(Database.getQueryLocator(baseQuery));
      con.setPageSize(size);
      totalRecords= con.getResultSize();
     
      set<id> myset=new set<id>();
     for(Apttus__APTS_Agreement__c   ap:agreements)
     {
             myset.add(ap.id);
     }
     attchmentsList =new list<Attachment>();
      attchmentsList = [select id,Name,parentid from Attachment where ParentId IN :myset];
      System.debug('----------------'   +attchmentsList);
     
    
      map<id,list<attachment>> groupbyMap = new  map<id,list<attachment>>();
     
      for(Attachment a : attchmentsList)
      {
         List<attachment> groupbyList=new list<attachment>();
        if(groupbymap.containskey(a.parentid))
         {
            groupbyList=groupbyMap.get(a.parentid);
            groupbyList.add(a);
            groupbyMap.put(a.parentid,groupbylist);
         }
        else
        {
           groupbyList.add(a);
           groupbymap.put(a.parentid,groupbyList);
        }
     }
  
     for(Apttus__APTS_Agreement__c a : agreements)
      {
              AgreemnetsWrapper wp = new AgreemnetsWrapper();
              wp.Agrid=a.id;
              wp.AgreementName=a.Name;
              wp.RecordType=a.Recordtype.name;
              wp.AgreementNumber=a.Apttus__FF_Agreement_Number__c;
              wp.Status=a.Apttus__Status_Category__c;
              wp.Approvalstatus =a.Apttus_Approval__Approval_Status__c;
              wp.Createddate=a.CreatedDate;
              wp.Owner=a.owner.FirstName+a.owner.Lastname;
              wp.AGSD=a.Apttus__Contract_Start_Date__c;
              wp.AGED=a.Apttus__Contract_End_Date__c;
              wp.Perpetual= a.Apttus__Perpetual__c;
              wp.AgreementAccount=a.Account_Agreement_Text__c;
              wp.relatedattachmentList=groupbyMap.get(a.id);
              if(groupbyMap.containskey(a.id))
          wrapperlist.add(wp);

      }
}
public Boolean hasNext {
        get {
            return Con.getHasNext();
        }
        set;
    }
    public Boolean hasPrevious {
        get {
            return Con.getHasPrevious();
        }
        set;
    }

    public Integer pageNumber {
        get {
            return Con.getPageNumber();
        }
        set;
    }

    public void first() {
       Con.first();
    }

    public void last() {
       Con.last();
    }

    public void previous() {
        Con.previous();
    }

    public void next() {
       Con.next();
       system.debug('pageNumber :'+pageNumber );
       system.debug('hasNext :'+hasNext );
    }

public pagereference ExportExcel()
                {
                    pagereference p = new pagereference('/apex/ExportExcel');
                    return p;
                   
                 }
  Public Class AgreemnetsWrapper {
    Public id Agrid{get;set;}
    Public String AgreementNumber{get;set;}
    Public String AgreementName{get;set;}
    public String AttachmentName{get;set;}
    public string RecordType{get;set;}
    public string Approvalstatus {get;set;}
    public datetime Createddate{get;set;}
    public date AGSD{get;set;}
    public date AGED{get;set;}
    public boolean Perpetual{get;set;}
    public string Owner{get;set;}
    public string agreementId {get;set;}
    Public string Status{get;set;}
    public string AgreementAccount{get;set;}
    public list<attachment> relatedattachmentList {get;set;}
   
    public attachment attachmnetwrapper {get;set;}
    Public Apttus__APTS_Agreement__c agreemnetwrapper {get; set;}
  }
}


Any help is appreciated..!!!
Thank you verymuch in advance..!!
Ramesh
How do I make vertical tables in HTML? By vertical, I mean the rows will be vertical with table headers on the left.

I have tried something like below, i can display results how i was expecting but when any field value is empty then that particulat  <td> cell is shrinking its height and making entire table big mess. I tried CSS "empty-cells: show" but it is also not working.

<style>
    table { border-collapse: separate; empty-cells: show; line-height:25px; }
     tr { display: block; float: left; width:200px;}
    th,  td { display: block; }
    #rich1 .sfdc_richtext img {width:90%; height:250px;}
  </style>

  <apex:form >

      <table border="1" class="variant-table" >
         <tr>
            <td style=" height:250px; border:0;"></td>
            <td style="background-color: #53B3AE;">Name</td>
            <td style="background-color: #53B3AE;">SKU Number</td>
            <td style="background-color: #53B3AE;">WAN</td>
            <td style="background-color: #53B3AE;">HAN</td>
            <td style="background-color: #53B3AE;">Physical Dimensions</td>
            <td style="background-color: #53B3AE;">Notes</td>
         </tr>
         <apex:repeat value="{!arqivaproducts}" var="p">
         <tr>
            <td id="rich1"><apex:outputField style=" border:none;" value="{!p.Arq_Product_Image__c}"></apex:outputField></td>
            <!-- <td> <apex:image style="align:center;" url="{!p.Arq_Product_Image__c}"  /></td> -->
            <td><apex:outputField value="{!p.Name}"></apex:outputField></td>
            <td><apex:outputField value="{!p.ccrz__SKU__c}"></apex:outputField></td>
            <td><apex:outputText value="{!p.CCArq_WAN__c}"></apex:outputText></td>
            <td><apex:outputText value="{!p.CCArq_HAN__c}"></apex:outputText></td>
            <td><apex:outputField value="{!p.CCArq_Physical_Dimensions__c}"></apex:outputField></td>
            <td><apex:outputField value="{!p.ccrz__LongDesc__c}"></apex:outputField></td>
         </tr>
         </apex:repeat>
      </table>
      
  </apex:form>


Please let me know if any one has any better solution than this or any adice how can i fix my issue when values are empty.

Thanks in Advance

Regards,
Ramesh
Hi All,

I have written Bulk Trigger to update date field based on the anothet date field on the same object. But my trigger is working for only first record only while inserting multiple records and for the rest of the records it is not updating.

Below is the code which i have used to update, not sure what wrong with my code and why it is not working for multiple records(bulk records). Please correct me if my code is wrong or if i have missed anything ???

Please reply if you find any sol.

Thanks a lot.
Ram

CODE:
trigger Update_PlannedShipmentDate on ccrz__E_OrderShipment__c (After insert, After Update) {

set<String> ccshipmentID= new set<String>();
List<ccrz__E_OrderShipment__c> shipmentList = New List<ccrz__E_OrderShipment__c>();

 
If(Recursion.isRecursion)
{
  system.debug('^^^^^^^ isRecursion:'+Recursion.isRecursion);
 
  For(ccrz__E_OrderShipment__c ccshipments : Trigger.New){
      ccshipmentID.add(ccshipments.id);
      system.debug('^^^^^^^ New SHipments:'+ccshipmentID);
  }
 
  system.debug('^^^^^^^ New SHipments:'+ccshipmentID);
  List<ccrz__E_OrderShipment__c> updateShipmentList = New List<ccrz__E_OrderShipment__c>();
  If(ccshipmentID.size() > 0 )
  {
     shipmentList = [select CCArq_Delivery_Time__c,Arq_Revised_Delivery_Date__c,Arq_Planned_Shipment_Date__c
                     FROM ccrz__E_OrderShipment__c
                     WHERE ID IN: ccshipmentID AND ccrz__Order__r.ccrz__Storefront__c ='ArqivaESales'];
     system.debug('^^^^^^^ Shipments list:'+shipmentList);
    
    
     For(ccrz__E_OrderShipment__c ccshipment : shipmentList )
     {
        if(ccshipment.CCArq_Delivery_Time__c != null && ccshipment.Arq_Revised_Delivery_Date__c == null)
        {
           ccshipment.Arq_Planned_Shipment_Date__c = date.newinstance(ccshipment.CCArq_Delivery_Time__c.year(), ccshipment.CCArq_Delivery_Time__c.month(), ccshipment.CCArq_Delivery_Time__c.day())- 5;
           updateShipmentList.add(ccshipment);
           system.debug('^^^^^^^ shipment:'+ccshipment);
        }
       else if(ccshipment.Arq_Revised_Delivery_Date__c != null)
        {
           ccshipment.Arq_Planned_Shipment_Date__c = ccshipment.Arq_Revised_Delivery_Date__c - 5;
           updateShipmentList.add(ccshipment);
           system.debug('^^^^^^^ update list:'+ccshipment);
        }
     }
    
      Recursion.isRecursion = false;
      system.debug('^^^^^^^ isRecursion:'+Recursion.isRecursion);
  }
  if(updateShipmentList.size() > 0){
          system.debug('^^^^^^^ update list:'+updateShipmentList);
          Update updateShipmentList;
         
   }
}

}
Hi Friends,

I have developed VF Page report for Portal Users which will displays records from one of Custom Object with Export Button to export results. This report can have min 200 records and max "46,000" records.

As we have view state limit in salesforce i can't display all records once so went for pagination option using Standard set controller and am displaying 2000 records at a time. Actual problem comes here, when user clicks on export button they could able to download only 2000 records (records from dat particular page not all 46,000 records at once).

Is there any way so that user can download all records once just like in salesforce report export functionality. i really Don't know to bring this functionality...looking for some ideas. Please share some piece of code or articles if you have already faced similar issue.

Thank you very much in advance.

Regards,
Ramesh
Hello Everyone...!

We are building a Customer Portal with force.com sites with customized login and home pages. We have a requiremnet that portal should allow at least 150 concurrent users logins at a time. Does this login limit can be controlled through coding or will salesforce takes care in the background. If salesforce takes care in the background are there any limits and if not can we controll this customly though apex coding??

Please help me ...thank you in advance.
 
Hi ,

we are Getting Apex CPU time limit exceeded error while looping thte large no of records.
According to our requirement we receive large file from webmethods(the file may contains 50,000 records) then need to inset arround all records through integration code.

while looping all the records getting below error.

12:43:33.539 (20539843589)|EXCEPTION_THROWN|[509]|System.LimitException: Apex CPU time limit exceeded
12:43:33.539 (20539876910)|SYSTEM_MODE_EXIT|false
12:43:33.539 (20539934252)|FATAL_ERROR|System.LimitException: Apex CPU time limit exceeded

Class.Arqiva_IntegrationUpdates3up.cartonUnitsToInsert: line 509, column 1
Class.Arqiva_IntegrationUpdates3up.ASNAckUpdate: line 303, column 1
AnonymousBlock: line 145, column 1
AnonymousBlock: line 145, column 1
12:43:33.808 (20540012301)|CUMULATIVE_LIMIT_USAGE
12:43:33.808|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 5 out of 100
  Number of query rows: 8 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 3 out of 150
  Number of DML rows: 391 out of 10000
  Maximum CPU time: 15042 out of 10000 ******* CLOSE TO LIMIT

anyone please help on thisissue.

Regards,
Naveen

 
How do I make vertical tables in HTML? By vertical, I mean the rows will be vertical with table headers on the left.

I have tried something like below, i can display results how i was expecting but when any field value is empty then that particulat  <td> cell is shrinking its height and making entire table big mess. I tried CSS "empty-cells: show" but it is also not working.

<style>
    table { border-collapse: separate; empty-cells: show; line-height:25px; }
     tr { display: block; float: left; width:200px;}
    th,  td { display: block; }
    #rich1 .sfdc_richtext img {width:90%; height:250px;}
  </style>

  <apex:form >

      <table border="1" class="variant-table" >
         <tr>
            <td style=" height:250px; border:0;"></td>
            <td style="background-color: #53B3AE;">Name</td>
            <td style="background-color: #53B3AE;">SKU Number</td>
            <td style="background-color: #53B3AE;">WAN</td>
            <td style="background-color: #53B3AE;">HAN</td>
            <td style="background-color: #53B3AE;">Physical Dimensions</td>
            <td style="background-color: #53B3AE;">Notes</td>
         </tr>
         <apex:repeat value="{!arqivaproducts}" var="p">
         <tr>
            <td id="rich1"><apex:outputField style=" border:none;" value="{!p.Arq_Product_Image__c}"></apex:outputField></td>
            <!-- <td> <apex:image style="align:center;" url="{!p.Arq_Product_Image__c}"  /></td> -->
            <td><apex:outputField value="{!p.Name}"></apex:outputField></td>
            <td><apex:outputField value="{!p.ccrz__SKU__c}"></apex:outputField></td>
            <td><apex:outputText value="{!p.CCArq_WAN__c}"></apex:outputText></td>
            <td><apex:outputText value="{!p.CCArq_HAN__c}"></apex:outputText></td>
            <td><apex:outputField value="{!p.CCArq_Physical_Dimensions__c}"></apex:outputField></td>
            <td><apex:outputField value="{!p.ccrz__LongDesc__c}"></apex:outputField></td>
         </tr>
         </apex:repeat>
      </table>
      
  </apex:form>


Please let me know if any one has any better solution than this or any adice how can i fix my issue when values are empty.

Thanks in Advance

Regards,
Ramesh
Hi All,

I have written Bulk Trigger to update date field based on the anothet date field on the same object. But my trigger is working for only first record only while inserting multiple records and for the rest of the records it is not updating.

Below is the code which i have used to update, not sure what wrong with my code and why it is not working for multiple records(bulk records). Please correct me if my code is wrong or if i have missed anything ???

Please reply if you find any sol.

Thanks a lot.
Ram

CODE:
trigger Update_PlannedShipmentDate on ccrz__E_OrderShipment__c (After insert, After Update) {

set<String> ccshipmentID= new set<String>();
List<ccrz__E_OrderShipment__c> shipmentList = New List<ccrz__E_OrderShipment__c>();

 
If(Recursion.isRecursion)
{
  system.debug('^^^^^^^ isRecursion:'+Recursion.isRecursion);
 
  For(ccrz__E_OrderShipment__c ccshipments : Trigger.New){
      ccshipmentID.add(ccshipments.id);
      system.debug('^^^^^^^ New SHipments:'+ccshipmentID);
  }
 
  system.debug('^^^^^^^ New SHipments:'+ccshipmentID);
  List<ccrz__E_OrderShipment__c> updateShipmentList = New List<ccrz__E_OrderShipment__c>();
  If(ccshipmentID.size() > 0 )
  {
     shipmentList = [select CCArq_Delivery_Time__c,Arq_Revised_Delivery_Date__c,Arq_Planned_Shipment_Date__c
                     FROM ccrz__E_OrderShipment__c
                     WHERE ID IN: ccshipmentID AND ccrz__Order__r.ccrz__Storefront__c ='ArqivaESales'];
     system.debug('^^^^^^^ Shipments list:'+shipmentList);
    
    
     For(ccrz__E_OrderShipment__c ccshipment : shipmentList )
     {
        if(ccshipment.CCArq_Delivery_Time__c != null && ccshipment.Arq_Revised_Delivery_Date__c == null)
        {
           ccshipment.Arq_Planned_Shipment_Date__c = date.newinstance(ccshipment.CCArq_Delivery_Time__c.year(), ccshipment.CCArq_Delivery_Time__c.month(), ccshipment.CCArq_Delivery_Time__c.day())- 5;
           updateShipmentList.add(ccshipment);
           system.debug('^^^^^^^ shipment:'+ccshipment);
        }
       else if(ccshipment.Arq_Revised_Delivery_Date__c != null)
        {
           ccshipment.Arq_Planned_Shipment_Date__c = ccshipment.Arq_Revised_Delivery_Date__c - 5;
           updateShipmentList.add(ccshipment);
           system.debug('^^^^^^^ update list:'+ccshipment);
        }
     }
    
      Recursion.isRecursion = false;
      system.debug('^^^^^^^ isRecursion:'+Recursion.isRecursion);
  }
  if(updateShipmentList.size() > 0){
          system.debug('^^^^^^^ update list:'+updateShipmentList);
          Update updateShipmentList;
         
   }
}

}