• Ram-SF
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 16
    Replies

In VF page I am using Google map api integration, at a paricular time interval while loading the page I am getting this "Content cannot be displayed: Connection reset" exception/error message. After some 2-5 sec while loading the same page I did not got any messages. Any idea/suggestion to fix this issue?

  • December 13, 2011
  • Like
  • 0

The following exception i got when run a DL from command line...

 

 

"API Batch Item limits limit exceeded"

 

I am using the params

dataAccess.readBatchSize value ="1"

 

I know more blogs are there to solve this issue...Any how i was struck for a day to solve this issue Any1 help for me...

The following error i got 

C:\Program Files\salesforce.com\Apex Data Loader 22.0\bin>call process "C:\Program Files\salesforce.com\Apex Data Loader 22.0\conf" process-conf.xml csvInsertAccountProcess
2011-07-16 17:23:57,265 INFO  [main] controller.Controller initLog (Controller.j
ava:367) - The log has been initialized
2011-07-16 17:23:57,281 INFO  [main] process.ProcessConfig getBeanFactory (Proce
ssConfig.java:78) - Loading process configuration from config file: C:\Program F
iles\salesforce.com\Apex Data Loader 22.0\conf\process-conf.xml
2011-07-16 17:23:57,406 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinit
ions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions from file
 [C:\Program Files\salesforce.com\Apex Data Loader 22.0\conf\process-conf.xml]
2011-07-16 17:23:57,437 ERROR [main] process.ProcessConfig getProcessInstance (P
rocessConfig.java:71) - Error loading process: process-conf.xml configuration fr
om config file: C:\Program Files\salesforce.com\Apex Data Loader 22.0\conf\proce
ss-conf.xml
org.springframework.beans.factory.BeanDefinitionStoreException: Line 1 in XML do
cument from file [C:\Program Files\salesforce.com\Apex Data Loader 22.0\conf\pro
cess-conf.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Co
ntent is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(ErrorHandlerWrapper.java:236)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalErro
r(ErrorHandlerWrapper.java:215)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:386)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:316)
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(X
MLScanner.java:1438)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Prolog
Dispatcher.dispatch(XMLDocumentScannerImpl.java:899)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:834)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:764)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:148)
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.
java:250)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Doc
umentBuilderImpl.java:292)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:222)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:173)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:148)
        at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFa
ctory.java:68)
        at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFa
ctory.java:56)
        at com.salesforce.dataloader.process.ProcessConfig.getBeanFactory(Proces
sConfig.java:79)
        at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(Pr
ocessConfig.java:68)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu
nner.java:260)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu
nner.java:246)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:219)
2011-07-16 17:23:57,484 FATAL [main] process.ProcessRunner topLevelError (Proces
sRunner.java:211) - Failed to create process
com.salesforce.dataloader.exception.ProcessInitializationException: Error loadin
g process: process-conf.xml configuration from config file: C:\Program Files\sal
esforce.com\Apex Data Loader 22.0\conf\process-conf.xml
        at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(Pr
ocessConfig.java:72)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu
nner.java:260)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu
nner.java:246)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:219)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Line
1 in XML document from file [C:\Program Files\salesforce.com\Apex Data Loader 22
.0\conf\process-conf.xml] is invalid; nested exception is org.xml.sax.SAXParseEx
ception: Content is not allowed in prolog.
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:229)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:173)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:148)
        at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFa
ctory.java:68)
        at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFa
ctory.java:56)
        at com.salesforce.dataloader.process.ProcessConfig.getBeanFactory(Proces
sConfig.java:79)
        at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(Pr
ocessConfig.java:68)
        ... 3 more
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(ErrorHandlerWrapper.java:236)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalErro
r(ErrorHandlerWrapper.java:215)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:386)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:316)
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(X
MLScanner.java:1438)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Prolog
Dispatcher.dispatch(XMLDocumentScannerImpl.java:899)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:834)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:764)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:148)
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.
java:250)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Doc
umentBuilderImpl.java:292)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:222)
        ... 9 more
C:\Program Files\salesforce.com\Apex Data Loader 22.0\bin>
Process-conf file
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="csvInsertAccountProcess"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
        <description>Inserts Accounts from CSV file into Account Standard Object.</description>
        <property name="name" value="csvInsertAccountProcess"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="false"/>
                <entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
                <entry key="sfdc.username" value="raamss@devforce.com"/>
	    <entry key="sfdc.password" value="bb384be643f572dc0857fd86d8228d391c816fa573515ac7e9a280e5dac02d68bf87b766d289e023" />
	    <entry key="process.encryptionKeyFile" value="C:\Program Files\salesforce.com\Apex Data Loader 22.0\Config\key.txt" />
                <entry key="sfdc.timeoutSecs" value="540"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
                <entry key="sfdc.entity" value="Account"/>
                <entry key="process.operation" value="insert"/>
                <entry key="process.mappingFile" value="D:\Raam-Laptop\Project\Andrew\DL\AccountMap.sdl"/>
                <entry key="dataAccess.name" value="D:\Raam-Laptop\Project\Andrew\DL\AccountSchedule.csv" /> 
                <entry key="dataAccess.type" value="csvRead" /> 
            </map>
        </property>
   </bean>
</beans>

 the command i used to generate encrypted password was ....

C:\Program Files\salesforce.com\Apex Data Loader 22.0\bin>encrypt.bat -g <mypassword+ST>

encrypeted key 

C:\Program Files\salesforce.com\Apex Data Loader 22.0\bin>encrypt.bat -e <mypassword+ST>
I dono how to solve this error? 

Hi.

 

I am working  to create a tool for search Knowledge-Articles. Using KnowledgeArticleVersion(http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_knowledgearticleversion.htm) i am able to get the article details, but here i did not found any way to get the ArticleType? It was needed when I pass the Article's URLName to a standard article display page. Any ideas ?

 

Thanks

Hi,

 

I need to display some of the Articles in a list. I had visted this URL(http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_knowledge_articleList.htm) , but is it need any conroller to display articles based the above URL...(I am getting no response)

 

 

Thanks

While i am trying this code i got Internal Salesforce error

 

List<sObject> verList = [SELECT Id,KnowledgeArticleId,PublishStatus FROM KnowledgeArticleVersion
WHERE PublishStatus='Online' AND  KnowledgeArticleId in (SELECT ParentId
FROM KnowledgeArticleViewStat )];
System.debug(':::'+verList);

 

Is there any reason?..

  • April 30, 2011
  • Like
  • 0

i have written this code in controller to appent date time 

string parentID ;
string year = String.valueOf(userInputAppointment.Appt_Date__c.year());
string month = String.valueOf(userInputAppointment.Appt_Date__c.month());
string day =  String.valueOf(userInputAppointment.Appt_Date__c.day());
string hour = userInputAppointment.Appt_24_From_Hour__c;
string minute =userInputAppointment.Appt_24_From_Min__c;
string second = '00';
string stringDate = year + '-' + month
 + '-' + day + ' ' + hour + ':' + 
minute + ':' + second;
Datetime startTime= 
   datetime.valueOf(stringDate);
 
test case i have written for it
Appointment__c app1 = new Appointment__c();
       
         app1.account__c=a.id;
         app1.Branch__c=b.id;
         app1.doctor__c=s1.id;
         app1.Appt_AM_PM__c='am';
          app1.Appt_Date__c=date.ValueOf('2011-09-21');
             
        app1.Appt_24_From_Hour__c='11';
        app1.Appt_24_From_Min__c = '60';
         string year = String.valueOf(app1.Appt_Date__c.year());
string month = String.valueOf(app1.Appt_Date__c.month());
string day =  String.valueOf(app1.Appt_Date__c.day());
string hour = app1.Appt_24_From_Hour__c;
string minute =app1.Appt_24_From_Min__c;
string second = '01';
string stringDate = year + '-' + month
 + '-' + day + ' ' + hour + ':' + minute + ':' + second;


Datetime startTime= 
   datetime.valueOf(stringDate);
but i am getting this error 
System.TypeException: Invalid date/time: 2011-9-21 11:null:00
plz help me how to cover the test case for the date part in the controller

 

 

The following exception i got when run a DL from command line...

 

 

"API Batch Item limits limit exceeded"

 

I am using the params

dataAccess.readBatchSize value ="1"

 

Dear all,

 

I created a multi select picklist with different countries and I chose for each people I created the countries he works with.

 

In my report, I have this result for example :

FR               2

FR, GB       1

GB              3

GB, USA    1

USA            1

 

I want to count each value and to have just one line for each country :

FR   3

GB   5

USA  2

 

How can I do to separate the picklist values ?

Do you have any suggestion for this pb ?

Thank you.

 

:smileyhappy:

My test case is failing . And giving this error

System.ListException: List index out of bounds: 0

Class.Oppctrldelete.save: line 66, column 15 Class.Oppctrldelete_Test.MyTestController: line 62, column 2 External entry point

So please help me to resolve this issue
 
public class Oppctrldelete
{
  
    decimal j = 0;

    public Oppctrldelete(ApexPages.StandardController controller) {


this.id =ApexPages.currentPage().getParameters().get('id');
op =[select id,name,Total_Invoiced__c,Total_Approved__c ,StageFilter__c,final_stage__c ,Quote_vs_Billings_Difference__c ,Filterstage__c,Total_Planned__c,Total_Submitted__c,ownerid,Purchase_order__c,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c from Opportunity where id=:id];

oli = [select id,Quantity,delete__c ,description,pricebookentry.name,UnitPrice,TotalPrice ,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid=:id];
if(op.StageFilter__c== 'Billing-Planned'){
opps =[select id,ownerid,Final_Stage__c,name,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c,Filterstage__c from Opportunity where Header_Opportunity__c =:op.id];
oppli = [select id,Line_Item_Total__c,Quantity,delete__c ,TotalPrice ,description,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in: opps];
}
else if(op.StageFilter__c== 'Billing-Submitted'){
opps =[select id,ownerid,Final_Stage__c,name,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c,Filterstage__c from Opportunity where Header_Opportunity__c =:op.id AND (stagename='Billing-Submitted' OR  stagename='Billing-Approved' OR  stagename='Billing-Invoiced')];
oppli = [select id,Line_Item_Total__c,Quantity,delete__c ,TotalPrice ,description,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in: opps];
}
else if(op.StageFilter__c== 'Billing-Approved'){
opps =[select id,ownerid,Final_Stage__c,name,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c,Filterstage__c from Opportunity where Header_Opportunity__c =:op.id  AND  (stagename='Billing-Approved' OR stagename='Billing-Invoiced')];
oppli = [select id,Line_Item_Total__c,Quantity,delete__c ,TotalPrice ,description,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in: opps];
}
else if(op.StageFilter__c== 'Billing-Invoiced'){
opps =[select id,ownerid,Final_Stage__c,name,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c,Filterstage__c from Opportunity where Header_Opportunity__c =:op.id   AND  stagename='Billing-Invoiced'];
oppli = [select id,Line_Item_Total__c,Quantity,delete__c ,TotalPrice ,description,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in: opps];
}

 //opadd =[select id, MAX(CloseDate)   from Opportunity Limit 1 ];
//oppli = [select id,Line_Item_Total__c,Quantity,delete__c ,TotalPrice ,description,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in: opps];
  Oppsnew = new List<Opportunity>();
  Opplinew = new List<Opportunitylineitem>();
   

   
    }
// Save The Updates on Opp and LineIems
   
   
   
   
    public PageReference save()    
     {
    for(Opportunity oppsk:opps){

if(oppsk.final_stage__c== 'Billing-Planned'){
oppsk.stagename='Billing-Planned';
}
if(oppsk.final_stage__c== 'Billing-Submitted'){
oppsk.stagename='Billing-Submitted';

}
if(oppsk.final_stage__c== 'Billing-Approved'){
oppsk.stagename='Billing-Approved';
}
if(oppsk.final_stage__c== 'Billing-Invoiced'){
oppsk.stagename='Billing-Invoiced';
}
}

        update oppli;
        oppli[0].Fire_Trigger__c = true;
        update Opps;
      //oli[0].Fire_Trigger__c = true;
        update oli;
        
        update op;
       
     
   return(new ApexPages.StandardController(Op)).view();
   
  
  
    }


// Cancel and go Back to Header Opportunity
 public PageReference cancel() {
     return(new ApexPages.StandardController(Op)).view();
        return null;
    }
    
    
    public PageReference addmonthdyn()
     { 
   //alert(opadd.CloseDate);
   integer d;
     integer lkj = opps.size();
     integer poi = lkj-1;
    // oli = [select id,Quantity,delete__c, TotalPrice ,description,pricebookentry.name,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid=:id];
  // Opportunity o =[select id,name,Final_Closed_Date__c,Week_End_Day__c,Estimated_Start_Date__c,Account.name,Year_of_close_date__c,Month_Of_Closedate__c,stagename,CloseDate,pricebook2id,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c from Opportunity where id=:id];
 
    OpportunitylineItem[] oli = [select id,TotalPrice,ListPrice,PricebookEntry.name,Quantity,PricebookEntry.Product2.Name , PricebookEntry.Product2.id, UnitPrice,PricebookEntryId,Opportunityid,Quote_Original_List_Price__c  from OpportunityLineItem where Opportunityid=:id] ;
    opps[poi] =  [select id,Final_Stage__c ,Final_Closed_Date__c,stagename,Description,AccountId ,Hold_My_date__c,Week_End_Day__c ,name,closedate,Estimated_Start_Date__c from Opportunity where Header_Opportunity__c=:op.id ORDER BY closedate DESC LIMIT 1];
   
    Opportunity LitOrd = new Opportunity();
    LitOrd.stagename = 'Billing-Planned';
    LitOrd.Header_Opportunity__c=op.id;     
    LitOrd.recordtypeid='012M000000008mu';
    string mon;    
  
      
    decimal x = (poi+1*30);     
    LitOrd.Hold_My_date__c = opps[poi].closedate +x.intValue();
    
    // LitOrd.closedate = o.closedate;
    // for(Opportunity opps2:opps)
      //{
       //LitOrd.closedate = opps2.closedate+60; 
      // LitOrd.closedate = LitOrd.closedate+30; 
    // }
     LitOrd.closedate = opps[poi].closedate+30; 
    //LitOrd.closedate = opps[poi].closedate;   
   // Integer currentyear = opps[poi].Hold_My_date__c.year();
   // Integer currentMonth = (opps[poi].Hold_My_date__c.Month())+1;
       Integer currentyear =  LitOrd.Hold_My_date__c.year();
       Integer currentMonth =  LitOrd.Hold_My_date__c.Month();
        if(currentMonth==1){
          mon = 'JAN';
          
         
         }
         else if(currentMonth==2){
         mon = 'FEB';
         }
          else if(currentMonth==3){
         mon = 'MAR';
         }
          else if(currentMonth==4){
         mon = 'APR';
         }
          else if(currentMonth==5){
         mon = 'MAY';
         }
          else if(currentMonth==6){
         mon = 'JUN';
         }
          else if(currentMonth==7){
         mon = 'JUL';
         }
          else if(currentMonth==8){
         mon = 'AUG';
         }
          else if(currentMonth==9){
         mon = 'SEP';
         }
          else if(currentMonth==10){
         mon = 'OCT';
         }
          else if(currentMonth==11){
         mon = 'NOV';
         }
          else if(currentMonth==12){
         mon = 'DEC';
         }
        
      LitOrd.accountid = opps[poi].accountid;
      LitOrd.name = op.Account.name+'-'+op.Name+'-'+'Billing'+'-'+mon+'-'+ currentyear;
      
      LitOrd.final_stage__c ='Billing-Planned';
      LitOrd.probability =100;
      LitOrd.amount = 100;
     // LitOrd.closedate = opps[poi].closedate;
      Oppsnew.add(LitOrd); 
      insert oppsnew;
    
    
    /*

      for(j=0;j<oli.size();j++){
         OpportunitylineItem LitOrdch = new OpportunitylineItem();
       for(opportunitylineitem oli1:oli){

        
                  
        // LitOrdch.quantity = oli1.quantity.intValue()/o.No_Of_Months_for_Billing__c.intValue();
      
       //LitOrdch.quantity = oli1.quantity;
     
     
           LitOrdch.quantity=oli1.quantity;
        
         LitOrdch.unitprice = oli1.unitprice; 
     
      // LitOrdch.opportunityid =opps[poi].id;
        LitOrdch.opportunityid =oppsnew[0].id;
       
       
  LitOrdch.PricebookEntryId=oli1.PricebookEntryId;
      LitOrdch.Product_Code__c = oli1.PricebookEntry.name;
      LitOrdch.Quote_Original_Quantity__c =oli1.quantity;
      LitOrdch.Quote_Original_Sale_Price__c =  oli1.unitprice;
      LitOrdch.Quote_Original_List_Price__c = oli1.unitprice;
       
         
       }
         Opplinew.add(LitOrdch); 
        }
    
    insert Opplinew;
    
  */
        PageReference customPage = new PageReference('/apex/opptctldelete'); 
 
   customPage.getParameters().put('id', this.id);
   customPage.setRedirect(true);
   return customPage; 
  
    }
    
    
    public PageReference Addmonth() 
    {
   
    update op;   
   // PageReference customPage = new PageReference('/apex/billingsubhash'); 
 //string i= ApexPages.currentPage().getParameters().get('id');
  PageReference customPage = new PageReference('/apex/redirect'); 
 
   customPage.getParameters().put('id', this.id);
   customPage.setRedirect(true);
   return customPage;
    
    
    }
    
    
    
    
    
    
    
    
  //Quick save changes
  
  
    public PageReference quicksave() {
    
    
     for(Opportunity oppsk:opps){

if(oppsk.final_stage__c== 'Billing-Planned'){
oppsk.stagename='Billing-Planned';
}
if(oppsk.final_stage__c== 'Billing-Submitted'){
oppsk.stagename='Billing-Submitted';

}
if(oppsk.final_stage__c== 'Billing-Approved'){
oppsk.stagename='Billing-Approved';
}
if(oppsk.final_stage__c== 'Billing-Invoiced'){
oppsk.stagename='Billing-Invoiced';
}
}

        update oppli;
        oppli[0].Fire_Trigger__c = true;
        update Opps;
      //oli[0].Fire_Trigger__c = true;
        update oli;
        
        update op;
       
     
   for(opportunity opps1:opps){
    for(Opportunitylineitem oppli1 :oppli){
        if(oppli1.Opportunityid==opps1.id && oppli1.delete__c == true)
        {
        delete oppli1;
            oppli[0].Fire_Trigger__c = true;
       update oli;
       update op;
     }
     }   
   
    }
   
   PageReference customPage = new PageReference('/apex/opptctldelete');   
  customPage.getParameters().put('id', this.id);
  customPage.setRedirect(true);
  return customPage; 
            
    }   
public PageReference incrementCounter() 
{

for(Opportunity opps2:opps){
    for(Opportunitylineitem oppli1:oppli){
    
    
    if(oppli1.OpportunityID == opps2.id   )
  
    {
    

     countindvidual = (oppli1.quantity*oppli1.unitprice);}
    
    
   } 
}  
return null;
}


 public PageReference quan()
   {
    totval=0.0; integer r=0;
    for(opportunity opps1:opps){
    for(Opportunitylineitem oppli1 :oppli)
    {
    if(oppli1.Opportunityid==opps1.id )
    {
      
    }
    }}
    return null;
 }  









  public PageReference childtotal()
   {
    totval=0.0;
    for(opportunity opps1:opps){
    for(Opportunitylineitem oppli1 :oppli)
    {
    if(oppli1.Opportunityid==opps1.id )
    {
     childtot = (oppli1.quantity*oppli1.unitprice)+totval;
     totval=childtot;
    }
    }}
    return null;
 }  
    
   //Get Total of All Billing Amounts 
     public PageReference grandtotal()
 { 
   gtotal=0;
   for(opportunity opps1:opps)
{  
   for(Opportunitylineitem oppli1 :oppli)
    {    
   if(oppli1.Opportunityid==opps1.id)
    {
   
    itotal= (oppli1.quantity*oppli1.unitprice)+gtotal;
    gtotal= itotal;
    // 
  

          }
       
    }
    }return null;
     }
    //Total for Billing Invoiced
    
     public PageReference BI()
 { 
   BItotal=0;
   for(opportunity oppsBI:opps)
{  
   for(Opportunitylineitem oppliBI :oppli)
    {    
   if(oppliBI.Opportunityid==oppsBI.id && oppsBI.final_stage__c =='Billing-Invoiced')
    {
   
    finalBItotal= (oppliBI.quantity*oppliBI.unitprice)+BItotal;
    BItotal= finalBItotal;
    



          }
          else if(oppliBI.Opportunityid==oppsBI.id && oppsBI.final_stage__c =='Billing-Planned'){
          BItotal= finalBItotal;
          }
                    else if(oppliBI.Opportunityid==oppsBI.id && oppsBI.final_stage__c !='Billing-Planned'){
          BItotal= finalBItotal;
          }
BItotal= finalBItotal;
       
    }
    }return null;
     }
   //end of total for billing invoiced
    
   public List<Opportunity> Oppsnew  {get; set;} 
   public List<Opportunitylineitem> Opplinew  {get; set;} 
public Opportunity Op ;
public Opportunity opadd;
public Opportunity[] Opps ;
public OpportunitylineItem[] Oppli ;
public OpportunitylineItem[] Oli ;
public string id;
 decimal gtotal=0.0;
 decimal itotal=0;
user u;
  decimal countindvidual;
  decimal actualcountindvidual;  
    decimal BItotal;
    decimal count = 0; 
  decimal finalBItotal =0;
   decimal counttotal = 0;
   decimal  totval;
   decimal childtot=0.0;
//public Oppctrldelete()
//{

/*
this.id =ApexPages.currentPage().getParameters().get('id');
op =[select id,name,Total_Invoiced__c,Total_Planned__c,Total_Submitted__c,ownerid,Purchase_order__c,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c from Opportunity where id=:id];
oli = [select id,Quantity,delete__c ,pricebookentry.name,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid=:id];
opps =[select id,ownerid,Final_Stage__c,name,Account.name,stagename,CloseDate,amount,probability,Header_Opportunity__c,Accountid,Opp_Line_Items_Count__c,Billing_Contact__c,No_Of_Months_for_Billing__c from Opportunity where Header_Opportunity__c =:op.id];

oppli = [select id,Line_Item_Total__c ,Quantity,delete__c ,description,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in: opps];
//oppli = [select id,Quantity,Description ,Delete__c ,UnitPrice,Opportunityid,Quote_Original_List_Price__c,Product_Code__c   from OpportunityLineItem where opportunityid in:opps or Product_Code__c =: opps[0].name];
*/
//}
public String getname()
{
return 'Oppctrldelete';
}
public Opportunity getop()
{
return op;
}
public user getu()
{
return u;
}
public Opportunity [] getopps()
{
/*
for(Opportunity oppsk:opps){

if(oppsk.final_stage__c== 'BP'){
oppsk.stagename='Billing-Planned';
}
if(oppsk.final_stage__c== 'BS'){
oppsk.stagename='Billing-Submitted';

}
if(oppsk.final_stage__c== 'BA'){
oppsk.stagename='Billing-Approved';
}
if(oppsk.final_stage__c== 'BI'){
oppsk.stagename='Billing-Invoiced';
}
}
*/
return opps;
}






 public PageReference filterstage()
  {
 update op;
   
  PageReference customPage = new PageReference('/apex/opptctldelete');   
  customPage.getParameters().put('id', this.id);
  customPage.setRedirect(true);
  return customPage; 
            
    }   



public OpportunitylineItem[] getoppli()
{

return oppli;
}
public OpportunitylineItem[] getoli()
{

return oli;
}

 
 
  public decimal gettotval()
 {
return totval;
}
public decimal getcountindvidual() {
return countindvidual;
}
 public decimal getgtotal()
 {
return gtotal;
} 
public decimal getBItotal()
 {
return BItotal;
} 
}


/*________------------------------_______*/

@isTest
private class Oppctrldelete_Test
{
static testmethod void MyTestController()
 {
        Pricebook2 standardPB = [select id from Pricebook2 where isStandard=true];

        Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price Book 2009 Products', IsActive = true);
        insert pb;
        
        Product2 prod = new Product2(Name = 'Anti-infectives 2007', Family = 'Best Practices', IsActive = true);
        insert prod;

        PricebookEntry standardPrice = new PricebookEntry(Pricebook2Id = standardPB.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
        insert standardPrice;

        PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
        insert pbe;
        
 Account a = new Account();
 a.name = 'raja';
 insert a ;
 
  Opportunity opp = new Opportunity();
 opp.Name = 'raja';
 opp.StageName = 'Closedwon';
 opp.StageFilter__c= 'Billing-Planned';
 opp.CloseDate = date.ValueOf('2009-09-21');
 opp.Pricebook2Id = pb.id;
 insert opp;
  
  OpportunitylineItem opli = new OpportunitylineItem  ();
  opli.opportunityid=opp.id;
  opli.TotalPrice=5;
  opli.quantity=3;
  opli.PricebookEntryId = pbe.id; 
  
  insert opli;
       
   update  opli;
   
  
   
  
 ApexPages.currentPage().getParameters().put('id', opp.id);
 ApexPages.StandardController con = new ApexPages.StandardController(opp);
 Oppctrldelete o = new Oppctrldelete(con);
 o.getname();
 o.getopps();
 o.filterstage();
 o.getoppli();
 o.getop();
 O.getu();
 o.getoli();
 o.getcountindvidual();
o.getgtotal();
o.getBItotal();
 o.gettotval();
 o.cancel();
 
 /*---------*/
 o.save();
 o.addmonthdyn();
 
 o.Addmonth();
 o.quicksave();
 o.incrementCounter();
 o.quan();
 o.childtotal();
 
  }
 }

 

I know more blogs are there to solve this issue...Any how i was struck for a day to solve this issue Any1 help for me...

The following error i got 

C:\Program Files\salesforce.com\Apex Data Loader 22.0\bin>call process "C:\Program Files\salesforce.com\Apex Data Loader 22.0\conf" process-conf.xml csvInsertAccountProcess
2011-07-16 17:23:57,265 INFO  [main] controller.Controller initLog (Controller.j
ava:367) - The log has been initialized
2011-07-16 17:23:57,281 INFO  [main] process.ProcessConfig getBeanFactory (Proce
ssConfig.java:78) - Loading process configuration from config file: C:\Program F
iles\salesforce.com\Apex Data Loader 22.0\conf\process-conf.xml
2011-07-16 17:23:57,406 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinit
ions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions from file
 [C:\Program Files\salesforce.com\Apex Data Loader 22.0\conf\process-conf.xml]
2011-07-16 17:23:57,437 ERROR [main] process.ProcessConfig getProcessInstance (P
rocessConfig.java:71) - Error loading process: process-conf.xml configuration fr
om config file: C:\Program Files\salesforce.com\Apex Data Loader 22.0\conf\proce
ss-conf.xml
org.springframework.beans.factory.BeanDefinitionStoreException: Line 1 in XML do
cument from file [C:\Program Files\salesforce.com\Apex Data Loader 22.0\conf\pro
cess-conf.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Co
ntent is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(ErrorHandlerWrapper.java:236)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalErro
r(ErrorHandlerWrapper.java:215)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:386)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:316)
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(X
MLScanner.java:1438)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Prolog
Dispatcher.dispatch(XMLDocumentScannerImpl.java:899)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:834)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:764)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:148)
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.
java:250)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Doc
umentBuilderImpl.java:292)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:222)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:173)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:148)
        at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFa
ctory.java:68)
        at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFa
ctory.java:56)
        at com.salesforce.dataloader.process.ProcessConfig.getBeanFactory(Proces
sConfig.java:79)
        at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(Pr
ocessConfig.java:68)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu
nner.java:260)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu
nner.java:246)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:219)
2011-07-16 17:23:57,484 FATAL [main] process.ProcessRunner topLevelError (Proces
sRunner.java:211) - Failed to create process
com.salesforce.dataloader.exception.ProcessInitializationException: Error loadin
g process: process-conf.xml configuration from config file: C:\Program Files\sal
esforce.com\Apex Data Loader 22.0\conf\process-conf.xml
        at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(Pr
ocessConfig.java:72)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu
nner.java:260)
        at com.salesforce.dataloader.process.ProcessRunner.getInstance(ProcessRu
nner.java:246)
        at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.ja
va:219)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Line
1 in XML document from file [C:\Program Files\salesforce.com\Apex Data Loader 22
.0\conf\process-conf.xml] is invalid; nested exception is org.xml.sax.SAXParseEx
ception: Content is not allowed in prolog.
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:229)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:173)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:148)
        at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFa
ctory.java:68)
        at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFa
ctory.java:56)
        at com.salesforce.dataloader.process.ProcessConfig.getBeanFactory(Proces
sConfig.java:79)
        at com.salesforce.dataloader.process.ProcessConfig.getProcessInstance(Pr
ocessConfig.java:68)
        ... 3 more
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(ErrorHandlerWrapper.java:236)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalErro
r(ErrorHandlerWrapper.java:215)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:386)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:316)
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(X
MLScanner.java:1438)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Prolog
Dispatcher.dispatch(XMLDocumentScannerImpl.java:899)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:834)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:764)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:148)
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.
java:250)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Doc
umentBuilderImpl.java:292)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:222)
        ... 9 more
C:\Program Files\salesforce.com\Apex Data Loader 22.0\bin>
Process-conf file
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="csvInsertAccountProcess"
          class="com.salesforce.dataloader.process.ProcessRunner"
          singleton="false">
        <description>Inserts Accounts from CSV file into Account Standard Object.</description>
        <property name="name" value="csvInsertAccountProcess"/>
        <property name="configOverrideMap">
            <map>
                <entry key="sfdc.debugMessages" value="false"/>
                <entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
                <entry key="sfdc.username" value="raamss@devforce.com"/>
	    <entry key="sfdc.password" value="bb384be643f572dc0857fd86d8228d391c816fa573515ac7e9a280e5dac02d68bf87b766d289e023" />
	    <entry key="process.encryptionKeyFile" value="C:\Program Files\salesforce.com\Apex Data Loader 22.0\Config\key.txt" />
                <entry key="sfdc.timeoutSecs" value="540"/>
                <entry key="sfdc.loadBatchSize" value="200"/>
                <entry key="sfdc.entity" value="Account"/>
                <entry key="process.operation" value="insert"/>
                <entry key="process.mappingFile" value="D:\Raam-Laptop\Project\Andrew\DL\AccountMap.sdl"/>
                <entry key="dataAccess.name" value="D:\Raam-Laptop\Project\Andrew\DL\AccountSchedule.csv" /> 
                <entry key="dataAccess.type" value="csvRead" /> 
            </map>
        </property>
   </bean>
</beans>

 the command i used to generate encrypted password was ....

C:\Program Files\salesforce.com\Apex Data Loader 22.0\bin>encrypt.bat -g <mypassword+ST>

encrypeted key 

C:\Program Files\salesforce.com\Apex Data Loader 22.0\bin>encrypt.bat -e <mypassword+ST>
I dono how to solve this error? 

I simply don't understand the idea of the difference between List and Non-List type(simple Object(DB) type).

List<ABCobject__c> abc and ABCobject__c

Names are the same.

Both are to be used.

 

Please correct what I understand about the List and Non-List(object(DB) type)

 

1.List type is to store data with index.

2.List type is needed to do something  if or while statement  while storing all data into List type object?

   Do something from the all data?

3. Non-List is simply needed to access single data from the Non-List object.

 

Thanks

Mori  

Hi,

 

I need to display some of the Articles in a list. I had visted this URL(http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_knowledge_articleList.htm) , but is it need any conroller to display articles based the above URL...(I am getting no response)

 

 

Thanks

While i am trying this code i got Internal Salesforce error

 

List<sObject> verList = [SELECT Id,KnowledgeArticleId,PublishStatus FROM KnowledgeArticleVersion
WHERE PublishStatus='Online' AND  KnowledgeArticleId in (SELECT ParentId
FROM KnowledgeArticleViewStat )];
System.debug(':::'+verList);

 

Is there any reason?..

  • April 30, 2011
  • Like
  • 0
I am Java/Apex rookie and I am trying to strip cr/lf characters from a string using the ReplaceAll method.  c.ReplaceAll('\r\n','') doesn't work I guess because '\r\n' isn't a regExp.  I'm sure there's a simple solution but I haven't found it yet.  Can anyone offer some help?
 
Thanks.


Message Edited by CMcCaul on 09-17-2008 11:45 AM
  • September 17, 2008
  • Like
  • 0