• Manuel Echeverria
  • NEWBIE
  • 20 Points
  • Member since 2015
  • Systems Engineer
  • Aircobrands

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 9
    Replies
Hi all.

I would like to know if anyone has any experience integrating Salesforce with SAP for Business One.

I tested Lightning connect in a dev org to connect with SAP and it's working fine. despite the expensive price of $4000 per month (It's too much for a small org), In one way it's fine to use this Salesforce feature as I read, it will create external objects in Salesforce and this works for us if I'm taking about accounts or pricing. But for Invoices we don't want to use it as external objects as invoices won't change to often and we see not useful to go to SAP when we should have that info inside Salesforce (mostly for report purposes).

Does anyone knows or can recommend me how to achieve this? to keep some SAP data inside Salesforce as an object and not as an external object or best practices to integrate Salesforce with SAP without buying an expensive middlewate?

Any advice will be really appreciate it.
Thanks everyone.

Hi Fellas.

I'm evaluating to migrate to Lightning Experience. However, I have in my classic home page layout some Dashboards that are relevant to all the sales reps, when I switch to Lightning Experience the home page layout it shows some standard fields. It looks very nice, but the thing is that I'm not using the opportunities standard object, so to show that chart it doesn't make sense.

Does anyone know how to setup your own home page layout for Lightning Experience or at least to hide/show some components?

I attached to pictures showing the two versions of home pages, and I only need to keep something similar to the classic version.

Thanks in advance guys.

Classic: 
User-added image

Lightning Experience:
User-added image
I am new in salesforce and I'm trying to make a call from a visualforce page inside salesforce1 (now called lightning, I think) to a Related List of contacts. My page show some options related to the Account object and one of this options is to show its Contacts (that's what I want but this code is not working):
 
<apex:outputPanel > 
<a href="sforce.one.navigateToRelatedList('Contacts', '{!idAccount}');"> 
 <input type="button" value="Contacts" class="register-button"/> 
</a> 
</apex:outputPanel>

I just want to show this: Is the same that you can see in Salesforce Lightning under Accounts/Related/Contacts
User-added image

And then...
User-added image
Hi.

I'm new in Salesforce but I have a quote that I need to show as a PDF with a header and a footer but just in the last page. Actually is working with renderAs="pdf" But is not showing the footer at the bottom of the page, it show it where it end (it could be at the beggining, middle or end). However if I don't write renderAs="pdf", it works fine but just as HTML page.

I made a simple dummy that you can edit writting and deleting the renderAs="pdf" to see the issue.

Any help would be really apprecciate it. 

This is the dummy:

<apex:page renderAs="pdf" applyHtmlTag="false" showHeader="false" sidebar="false" readOnly="true" >
<html>
    <head>
        <style> 
        html,
body {
margin:0;
padding:0;
height:100%;
}
#wrapper {
min-height:100%;
position:relative;
}
#header {
padding:10px;
background:#5ee;
}
#content {
padding:10px;
padding-bottom:80px;   /* Height of the footer element */
}
#footer {
width:100%;
height:80px;
position:absolute;
     content : "My Footer on right Side";
bottom:0;
left:0;
background:#ee5;
}
        </style>
    </head>
    <body>
<div id="wrapper">
        <div id="header"></div>
        <div id="content"></div>
<span>
<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE
<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE
<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE
<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE
<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE
<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE
<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE
<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE
<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE
<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE
<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE<br/>THIS IS AN EXAMPLE
</span>        
        <div id="footer"> content : "My Footer on right Side";</div>
</div>
</body>
</html>
</apex:page>
I need to alter or set the system.date to another date for testing purposes (test the trigger), but I can't find a way to do it.

The trigger works great but it take the system.now().date as a value and the Test coverage always fails because I can not test all the cases:  

Example

   
    Datetime required = system.now().date();    
    Datetime validDate = system.now().date();     
    String todayDay= validDate.formatGMT('EEEE');  

   for ( Order__c Order : Trigger.new )
    {
        Order__c queryOrder= [SELECT Id,Name,Otter_FFA_Is_Updatable__c,Required_Date__c From Order__c where Id=:Order.Id];
        //if was no update through QAD
        if ((queryOrder.Otter_FFA_Is_Updatable__c=='')||(queryOrder.Otter_FFA_Is_Updatable__c==null))
        {//if Required_Date__c != null
        if ( Order.Required_Date__c != null )
        {
        required = Order.Required_Date__c;
            if(validDate.date().daysBetween(required.date())<=1){//If there is a difference of one day 
            if (todayDay.toUpperCase() =='THURSDAY'){
                if (hour<11){days=1;}
                else {days=4;}
            }
            else if (todayDay.toUpperCase() =='FRIDAY'){
                if (hour<11){days=3;}
                else {days=4;}
            }
            else if (todayDay.toUpperCase() =='SATURDAY'){
              {days=3;}
            }
            else if (todayDay.toUpperCase() =='SUNDAY'){
              {days=2;}
            }                
            else {
                if (hour<11){days=1;}
                else {days=2;}
            }

                
Those Thursday, friday, saturday and sunday I can test it.

Any advice will be appreciate it.
I have a VisualForce page embedded in my Opportunity layout. If a user makes changes to the Opportunity fields and then also makes changes in the embedded VisualForce page, they can't save both changes. They either have to save the Opportunity or save the VisualForce page, losing their changes to the other one.

Is there any way to let our users save both changes at the same time? For reference, see below for the VisualForce Page and Extension involved:


VisualForce Page:
<apex:page standardController="Opportunity" Extensions="ControllerContactSelectionOpportunity">
    
    <style>
        .added {
            background-color: #a4f3fc;
        }
        .removed {
            background-color: white;
        }
    </style>
    
    <apex:form >
    
        <apex:pageBlock >
            
            <apex:pageBlockTable  value="{!Records}" var="Con">
                
                <apex:column headerValue="Add To Opportunity" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.attach}"/>
                </apex:column>
                <apex:column headerValue="Name" value="{!Con.Name}" styleClass="{!IF(Con.attach == TRUE,'added','removed')}"/>
                <apex:column headerValue="Main User" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.mainUser}"/>
                </apex:column>
                <apex:column headerValue="General User" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.genUser}"/>
                </apex:column>
                <apex:column headerValue="Billing" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.billing}"/>
                </apex:column>
                <apex:column headerValue="E-Commerce" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.eComm}"/>
                </apex:column>
                <apex:column headerValue="Email" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.email}"/>
                </apex:column>
                <apex:column headerValue="CRM" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.crm}"/>
                </apex:column>
                <apex:column headerValue="Junior Decision Maker" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.junior}"/>
                </apex:column>
                <apex:column headerValue="Senior Decision Maker" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.senior}"/>
                </apex:column>
                <apex:column headerValue="Signature" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.signature}"/>
                </apex:column>
                <apex:column headerValue="Coach" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.coach}"/>
                </apex:column>
                <apex:column headerValue="Champion" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.champion}"/>
                </apex:column>
                <apex:column headerValue="I Don't Know" styleClass="{!IF(Con.attach == TRUE,'added','removed')}">
                    <apex:inputCheckbox value="{!Con.idk}"/>
                </apex:column>
                
            </apex:pageBlockTable>
            
            <Apex:pageBlockButtons location="bottom">
            
                <apex:commandButton action="{!customSave}" value="Save"/>
            
            </Apex:pageBlockButtons>
            
            <apex:outputPanel rendered="{!refreshPage}">
               <script>
                  window.top.location='/{!Opportunity.Id}';
               </script>
            </apex:outputPanel>
        
        </apex:pageBlock>
    
    </apex:form>
    
</apex:page>


Extension:
public class ControllerContactSelectionOpportunity{
    
    public class contactAttach{
        
        public string name {get;set;}
        public Boolean attach {get; set;}
        public Boolean mainUser {get; set;}
        public Boolean genUser {get; set;}
        public Boolean billing {get; set;}
        public Boolean eComm {get; set;}
        public Boolean email {get; set;}
        public Boolean crm {get; set;}
        public Boolean junior {get; set;}
        public Boolean senior {get; set;}
        public Boolean signature {get; set;}
        public Boolean coach {get; set;}
        public Boolean champion {get; set;}
        public Boolean idk {get; set;}
        public Contact con {get; set;}
        
    }
    
    public List<contactAttach> Records {get; set;}
    public Boolean refreshPage {get; set;}
    public Opportunity Record;
    public Set<String> roleContacts;
    public Map<String,OpportunityContactRole> roleMap;
    public Map<String,String> roleIDMap;
    
    public ControllerContactSelectionOpportunity(ApexPages.StandardController controller){
        
        Records = new List<contactAttach>();
        List<contactAttach> addedRecords = new List<contactAttach>();
        List<contactAttach> removedRecords = new List<contactAttach>();
        Record = (Opportunity) controller.getRecord();
        String AccountId = [SELECT AccountId FROM Opportunity WHERE Id = :Record.Id LIMIT 1].AccountId;
        roleContacts = new Set<String>();
        roleMap = new Map<String,OpportunityContactRole>();
        roleIDMap = new Map<String,String>();
        refreshPage = FALSE;
        
        FOR(OpportunityContactRole ocr : [SELECT
                                         	Id,
                                         	ContactId
                                          FROM
                                         	OpportunityContactRole
                                          WHERE
                                          	OpportunityId = :Record.Id]){
                                              
                                              roleContacts.add(ocr.ContactId);
                                              roleMap.put(ocr.ContactId,ocr);
                                              roleIDMap.put(ocr.ContactId,ocr.Id);
                                              
                                          }
        
        FOR(Contact c : [SELECT 
                             	Id, 
                             	Name,
                             	Main_User__c, 
                             	General_User__c,
                             	Billing__c,
                             	E_Commerce__c,
                             	Email__c,
                             	CRM__c,
                             	Junior_Decision_Maker__c,
                             	Senior_Decision_Maker__c,
                             	Signature__c,
                             	Coach__c,
                             	Champion__c,
                             	I_Don_t_Know__c
                             FROM 
                             	Contact 
                             WHERE 
                             	AccountId = :AccountId
                        	 ORDER BY Name ASC]){
                                    
                                    contactAttach ca = new contactAttach();
                                    ca.Name = c.Name;
                                    ca.attach = roleContacts.contains(c.Id) ? TRUE : FALSE;
                                    ca.mainUser = c.Main_User__c;
                                    ca.genUser = c.General_User__c;
                                    ca.billing = c.Billing__c;
                                    ca.eComm = c.E_Commerce__c;
                                    ca.email = c.Email__c;
                                    ca.crm = c.CRM__c;
                                    ca.junior = c.Junior_Decision_Maker__c;
                                    ca.senior = c.Senior_Decision_Maker__c;
                                    ca.signature = c.Signature__c;
                                    ca.coach = c.Coach__c;
                                    ca.champion = c.Champion__c;
                                    ca.idk = c.I_Don_t_Know__c;
                                    ca.con = c;
                                 
                                 IF(ca.attach == TRUE){
                                     
                                     addedRecords.add(ca);
                                     
                                 }
                                 ELSE{
                                     
                                     removedRecords.add(ca);
                                     
                                 }
            
        }
        
        FOR(contactAttach ar : addedRecords){
            
            Records.add(ar);
            
        }
        
        FOR(contactAttach rr : removedRecords){
            
            Records.add(rr);
            
        }
        
        
    }
    
    public PageReference CustomSave(){
        
        Set<String> contactsChanged = new Set<String>();
        List<Contact> contactsToUpdate = new List<Contact>();
        List<OpportunityContactRole> rolesToAdd = new List<OpportunityContactRole>();
        List<OpportunityContactRole> rolesToChange = new List<OpportunityContactRole>();
        List<OpportunityContactRole> rolesToDelete = new List<OpportunityContactRole>();
        
        FOR(contactAttach cna : Records){
                
            IF(cna.con.Main_User__c != cna.mainUser || cna.con.General_User__c != cna.genUser ||
               cna.con.Billing__c != cna.billing || cna.con.E_Commerce__c != cna.eComm ||
               cna.con.Email__c != cna.email || cna.con.CRM__c != cna.crm ||
               cna.con.Junior_Decision_Maker__c != cna.junior ||  cna.con.Senior_Decision_Maker__c != cna.senior ||
               cna.con.Signature__c != cna.signature || cna.con.Coach__c != cna.coach ||
               cna.con.Champion__c != cna.champion || cna.con.I_Don_t_Know__c != cna.idk){
                
                cna.con.Main_User__c = cna.mainUser;
                cna.con.General_User__c = cna.genUser;
                cna.con.Billing__c = cna.billing;
                cna.con.E_Commerce__c = cna.eComm;
                cna.con.Email__c = cna.email;
                cna.con.CRM__c = cna.crm;
                cna.con.Junior_Decision_Maker__c = cna.junior;
                cna.con.Senior_Decision_Maker__c = cna.senior;
                cna.con.Signature__c = cna.signature;
                cna.con.Coach__c = cna.coach;
                cna.con.Champion__c = cna.champion;
                cna.con.I_Don_t_Know__c = cna.idk;
                contactsToUpdate.add(cna.con);
                contactsChanged.add(cna.con.Id);
                
            }
            
            IF(cna.attach == TRUE && !roleContacts.contains(cna.con.Id)){
                
                OpportunityContactRole cr = new OpportunityContactRole();
                cr.ContactId = cna.con.Id;
                cr.OpportunityId = Record.Id;
                cr.Role = cna.mainUser == TRUE ? 'Main User' 
                    	: cna.genUser == TRUE ? 'General User' 
                    	: cna.billing == TRUE ? 'Billing' 
                    	: cna.eComm == TRUE ? 'E-Commerce' 
                    	: cna.email == TRUE ? 'Email' 
                    	: cna.crm == TRUE ? 'CRM' 
                    	: cna.junior == TRUE ? 'Junior' 
                    	: cna.senior == TRUE ? 'Senior' 
                    	: cna.signature == TRUE ? 'Signature' 
                    	: cna.coach == TRUE ? 'Coach' 
                    	: cna.champion == TRUE ? 'Champion' 
                    	: 'Other';
                rolesToAdd.add(cr);
                
            }
            ELSE IF(cna.attach == TRUE && roleContacts.contains(cna.con.Id) && contactsChanged.contains(cna.con.Id)){
                
                OpportunityContactRole cru = new OpportunityContactRole();
                cru.Id = roleIDMap.get(cna.con.Id);
                cru.Role = cna.mainUser == TRUE ? 'Main User' 
                    	 : cna.genUser == TRUE ? 'General User' 
                    	 : cna.billing == TRUE ? 'Billing' 
                    	 : cna.eComm == TRUE ? 'E-Commerce' 
                    	 : cna.email == TRUE ? 'Email' 
                    	 : cna.crm == TRUE ? 'CRM' 
                    	 : cna.junior == TRUE ? 'Junior' 
                    	 : cna.senior == TRUE ? 'Senior' 
                    	 : cna.signature == TRUE ? 'Signature' 
                    	 : cna.coach == TRUE ? 'Coach' 
                    	 : cna.champion == TRUE ? 'Champion' 
                    	 : 'Other';
                rolesToChange.add(cru);
                
            }
            ELSE IF(cna.attach == FALSE && roleContacts.contains(cna.con.Id)){
                
                rolesToDelete.add(roleMap.get(cna.con.Id));
                
            }
            
        }
        
        IF(!contactsToUpdate.isEmpty()){
            
            UPDATE contactsToUpdate;
            
        }
    
        IF(!rolesToAdd.isEmpty()){
            
            INSERT rolesToAdd;
            
        }
        
        IF(!rolesToChange.isEmpty()){
            
            UPDATE rolesToChange;
            
        }
        
        IF(!rolesToDelete.isEmpty()){
            
            DELETE rolesToDelete;
            
        }
        
        refreshPage = TRUE;
        RETURN null;
        
    }

}


Thanks,
Greg
Hi all.

I would like to know if anyone has any experience integrating Salesforce with SAP for Business One.

I tested Lightning connect in a dev org to connect with SAP and it's working fine. despite the expensive price of $4000 per month (It's too much for a small org), In one way it's fine to use this Salesforce feature as I read, it will create external objects in Salesforce and this works for us if I'm taking about accounts or pricing. But for Invoices we don't want to use it as external objects as invoices won't change to often and we see not useful to go to SAP when we should have that info inside Salesforce (mostly for report purposes).

Does anyone knows or can recommend me how to achieve this? to keep some SAP data inside Salesforce as an object and not as an external object or best practices to integrate Salesforce with SAP without buying an expensive middlewate?

Any advice will be really appreciate it.
Thanks everyone.

Hi Fellas.

I'm evaluating to migrate to Lightning Experience. However, I have in my classic home page layout some Dashboards that are relevant to all the sales reps, when I switch to Lightning Experience the home page layout it shows some standard fields. It looks very nice, but the thing is that I'm not using the opportunities standard object, so to show that chart it doesn't make sense.

Does anyone know how to setup your own home page layout for Lightning Experience or at least to hide/show some components?

I attached to pictures showing the two versions of home pages, and I only need to keep something similar to the classic version.

Thanks in advance guys.

Classic: 
User-added image

Lightning Experience:
User-added image
I am new in salesforce and I'm trying to make a call from a visualforce page inside salesforce1 (now called lightning, I think) to a Related List of contacts. My page show some options related to the Account object and one of this options is to show its Contacts (that's what I want but this code is not working):
 
<apex:outputPanel > 
<a href="sforce.one.navigateToRelatedList('Contacts', '{!idAccount}');"> 
 <input type="button" value="Contacts" class="register-button"/> 
</a> 
</apex:outputPanel>

I just want to show this: Is the same that you can see in Salesforce Lightning under Accounts/Related/Contacts
User-added image

And then...
User-added image
I need to alter or set the system.date to another date for testing purposes (test the trigger), but I can't find a way to do it.

The trigger works great but it take the system.now().date as a value and the Test coverage always fails because I can not test all the cases:  

Example

   
    Datetime required = system.now().date();    
    Datetime validDate = system.now().date();     
    String todayDay= validDate.formatGMT('EEEE');  

   for ( Order__c Order : Trigger.new )
    {
        Order__c queryOrder= [SELECT Id,Name,Otter_FFA_Is_Updatable__c,Required_Date__c From Order__c where Id=:Order.Id];
        //if was no update through QAD
        if ((queryOrder.Otter_FFA_Is_Updatable__c=='')||(queryOrder.Otter_FFA_Is_Updatable__c==null))
        {//if Required_Date__c != null
        if ( Order.Required_Date__c != null )
        {
        required = Order.Required_Date__c;
            if(validDate.date().daysBetween(required.date())<=1){//If there is a difference of one day 
            if (todayDay.toUpperCase() =='THURSDAY'){
                if (hour<11){days=1;}
                else {days=4;}
            }
            else if (todayDay.toUpperCase() =='FRIDAY'){
                if (hour<11){days=3;}
                else {days=4;}
            }
            else if (todayDay.toUpperCase() =='SATURDAY'){
              {days=3;}
            }
            else if (todayDay.toUpperCase() =='SUNDAY'){
              {days=2;}
            }                
            else {
                if (hour<11){days=1;}
                else {days=2;}
            }

                
Those Thursday, friday, saturday and sunday I can test it.

Any advice will be appreciate it.

SImple VF page it's work perfect.


<apex:page >
    <apex:includeScript value="{!URLFOR($Resource.Xsolla_Jquery_min, '')}"/>
    <apex:includeScript value="{!URLFOR($Resource.Xsolla_Jquery_custom_min, '')}"/>
    <apex:includeScript value="{!URLFOR($Resource.Xsolla_Jquery_timepicker, '')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.Xsolla_Jquery_css, '')}"/> 
 
    <script language="javascript">
           $(function() { 
                            $('#datepicker').datetimepicker({
                                showSecond: true,
                                timeFormat: 'hh:mm:ss',
                                stepHour: 2,
                                stepMinute: 10,
                                stepSecond: 10
                            });
                        }); 
    </script>
      
    <input type="text" name="date" id="datepicker" value="01.06.2009 00:00"/> 
 
</apex:page>

But in on the page tabPanel, 

 

3_3_3.Finalorg.ajax4jsf.javascript.PrototypeScript:265Uncaught TypeError: Object [object Object] has no method 'dispatchEvent'
3_3_3.Finalorg.ajax4jsf.javascript.PrototypeScript:106Uncaught TypeError: Object [object Object] has no method 'hasClassName'
3_3_3.Finalorg.ajax4jsf.javascript.PrototypeScript:106Uncaught TypeError: Cannot read property 'length' of undefined
3_3_3.Finalorg.ajax4jsf.javascript.PrototypeScript:107Uncaught TypeError: Cannot call method 'replace' of undefined

I'am add to code, this fix error, but calendar not show

<script type="text/javascript">

         jQuery.noConflict();

</script> 

 

How to fix this problem?


 

I am having the following Apex code in my class:

 

public List<SelectOption> getItems() {
                List<SelectOption> options = new List<SelectOption>();
                options.add(new SelectOption('US','US'));
                options.add(new SelectOption('CANADA','Canada'));
                options.add(new SelectOption('MEXICO','Mexico'));
                return options;
        }

The visual force page code which fetches all information is as below:

 

<apex:selectList size="1" id="countryList" onChange="setCountry(this.value);">
    <apex:selectOptions value="{!items}"/>
    </apex:selectList>

 

 

The default value that we get after executing this visual force page is US, but I want it to be suppose Canada, How can i do it.

Please Help.

 

Regards,

Lakshman

 

~Share Knowledge, grow more~