• Angello Camacho Drago
  • NEWBIE
  • 10 Points
  • Member since 2017
  • Salesforce Developer
  • SOS Children's Village International

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 14
    Replies
I have an issue, I tried to use a [jQuery Time Range Slider][1] inside a visualforce page but doesn't work, I tried different jquery versions, can any one help me?

this is my code:
 
<apex:page controller="SeekerController" sidebar="false" title="Posiciones Fuerza de Ventas" docType="html-5.0">
<script type="text/javascript" src="https://maps.google.com/maps/api/js?key=AIzaSyAtxPCGB4rExpez5r0kzHibcs94FsPpj9U"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
<style type="text/css" media="print">
	#time-range p {
	    font-family:"Arial", sans-serif;
	    font-size:14px;
	    color:#333;
	}
	.ui-slider-horizontal {
	    height: 8px;
	    background: #D7D7D7;
	    border: 1px solid #BABABA;
	    box-shadow: 0 1px 0 #FFF, 0 1px 0 #CFCFCF inset;
	    clear: both;
	    margin: 8px 0;
	    -webkit-border-radius: 6px;
	    -moz-border-radius: 6px;
	    -ms-border-radius: 6px;
	    -o-border-radius: 6px;
	    border-radius: 6px;
	}
	.ui-slider {
	    position: relative;
	    text-align: left;
	}
	.ui-slider-horizontal .ui-slider-range {
	    top: -1px;
	    height: 100%;
	}
	.ui-slider .ui-slider-range {
	    position: absolute;
	    z-index: 1;
	    height: 8px;
	    font-size: .7em;
	    display: block;
	    border: 1px solid #5BA8E1;
	    box-shadow: 0 1px 0 #AAD6F6 inset;
	    -moz-border-radius: 6px;
	    -webkit-border-radius: 6px;
	    -khtml-border-radius: 6px;
	    border-radius: 6px;
	    background: #81B8F3;
	    background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgi…pZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
	    background-size: 100%;
	    background-image: -webkit-gradient(linear, 50% 0, 50% 100%, color-stop(0%, #A0D4F5), color-stop(100%, #81B8F3));
	    background-image: -webkit-linear-gradient(top, #A0D4F5, #81B8F3);
	    background-image: -moz-linear-gradient(top, #A0D4F5, #81B8F3);
	    background-image: -o-linear-gradient(top, #A0D4F5, #81B8F3);
	    background-image: linear-gradient(top, #A0D4F5, #81B8F3);
	}
	.ui-slider .ui-slider-handle {
	    border-radius: 50%;
	    background: #F9FBFA;
	    background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgi…pZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
	    background-size: 100%;
	    background-image: -webkit-gradient(linear, 50% 0, 50% 100%, color-stop(0%, #C7CED6), color-stop(100%, #F9FBFA));
	    background-image: -webkit-linear-gradient(top, #C7CED6, #F9FBFA);
	    background-image: -moz-linear-gradient(top, #C7CED6, #F9FBFA);
	    background-image: -o-linear-gradient(top, #C7CED6, #F9FBFA);
	    background-image: linear-gradient(top, #C7CED6, #F9FBFA);
	    width: 22px;
	    height: 22px;
	    -webkit-box-shadow: 0 2px 3px -1px rgba(0, 0, 0, 0.6), 0 -1px 0 1px rgba(0, 0, 0, 0.15) inset, 0 1px 0 1px rgba(255, 255, 255, 0.9) inset;
	    -moz-box-shadow: 0 2px 3px -1px rgba(0, 0, 0, 0.6), 0 -1px 0 1px rgba(0, 0, 0, 0.15) inset, 0 1px 0 1px rgba(255, 255, 255, 0.9) inset;
	    box-shadow: 0 2px 3px -1px rgba(0, 0, 0, 0.6), 0 -1px 0 1px rgba(0, 0, 0, 0.15) inset, 0 1px 0 1px rgba(255, 255, 255, 0.9) inset;
	    -webkit-transition: box-shadow .3s;
	    -moz-transition: box-shadow .3s;
	    -o-transition: box-shadow .3s;
	    transition: box-shadow .3s;
	}
	.ui-slider .ui-slider-handle {
	    position: absolute;
	    z-index: 2;
	    width: 22px;
	    height: 22px;
	    cursor: default;
	    border: none;
	    cursor: pointer;
	}
	.ui-slider .ui-slider-handle:after {
	    content:"";
	    position: absolute;
	    width: 8px;
	    height: 8px;
	    border-radius: 50%;
	    top: 50%;
	    margin-top: -4px;
	    left: 50%;
	    margin-left: -4px;
	    background: #30A2D2;
	    -webkit-box-shadow: 0 1px 1px 1px rgba(22, 73, 163, 0.7) inset, 0 1px 0 0 #FFF;
	    -moz-box-shadow: 0 1px 1px 1px rgba(22, 73, 163, 0.7) inset, 0 1px 0 0 white;
	    box-shadow: 0 1px 1px 1px rgba(22, 73, 163, 0.7) inset, 0 1px 0 0 #FFF;
	}
	.ui-slider-horizontal .ui-slider-handle {
	    top: -.5em;
	    margin-left: -.6em;
	}
	.ui-slider a:focus {
	    outline:none;
	}
	
	#slider-range {
	  width: 90%;
	  margin: 0 auto;
	}
	#time-range {
	  width: 400px;
	}
</style>

<script>              
   $j = jQuery.noConflict(); 
 
  //this function will be called as soon as page load is complete
		$j("#slider-range").slider({
		    range: true,
		    min: 0,
		    max: 1440,
		    step: 15,
		    values: [540, 1020],
		    slide: function (e, ui) {
		        var hours1 = Math.floor(ui.values[0] / 60);
		        var minutes1 = ui.values[0] - (hours1 * 60);
		
		        if (hours1.length == 1) hours1 = '0' + hours1;
		        if (minutes1.length == 1) minutes1 = '0' + minutes1;
		        if (minutes1 == 0) minutes1 = '00';
		        if (hours1 >= 12) {
		            if (hours1 == 12) {
		                hours1 = hours1;
		                minutes1 = minutes1 + " PM";
		            } else {
		                hours1 = hours1 - 12;
		                minutes1 = minutes1 + " PM";
		            }
		        } else {
		            hours1 = hours1;
		            minutes1 = minutes1 + " AM";
		        }
		        if (hours1 == 0) {
		            hours1 = 12;
		            minutes1 = minutes1;
		        }
		
		
		
		        $j('.slider-time').html(hours1 + ':' + minutes1);
		
		        var hours2 = Math.floor(ui.values[1] / 60);
		        var minutes2 = ui.values[1] - (hours2 * 60);
		
		        if (hours2.length == 1) hours2 = '0' + hours2;
		        if (minutes2.length == 1) minutes2 = '0' + minutes2;
		        if (minutes2 == 0) minutes2 = '00';
		        if (hours2 >= 12) {
		            if (hours2 == 12) {
		                hours2 = hours2;
		                minutes2 = minutes2 + " PM";
		            } else if (hours2 == 24) {
		                hours2 = 11;
		                minutes2 = "59 PM";
		            } else {
		                hours2 = hours2 - 12;
		                minutes2 = minutes2 + " PM";
		            }
		        } else {
		            hours2 = hours2;
		            minutes2 = minutes2 + " AM";
		        }
		
		        $j('.slider-time2').html(hours2 + ':' + minutes2);
		    }
		});
</script>

<div id="time-range">
    <p>Time Range: <span class="slider-time">9:00 AM</span> - <span class="slider-time2">5:00 PM</span>

    </p>
    <div class="sliders_step1">
        <div id="slider-range"></div>
    </div>
</div>
</apex:page>

 
Hi every one, I have a trigger that when I insert data into a custom object create a map with the id of a contact as a key and a list of the custom object as the value, when I check if the key is contained in the map I get true, but when I try to get the value I get (), but when I filled the map I check if the list has items with an if list.size()>0, this is my code:
 
Map<Id, List<npe03__Recurring_Donation__c>> rdsMap = new Map<Id, List<npe03__Recurring_Donation__c>>();
  for(Id id : Ids){
    List<npe03__Recurring_Donation__c> rdOld = new List<npe03__Recurring_Donation__c>();
    for(npe03__Recurring_Donation__c rd : rds){
      if(rd.npe03__Organization__c != null){
        if(id == rd.npe03__Organization__c){
          rdOld.add(rd);
        }
      }
      else if(rd.npe03__Contact__c != null){
        if(id == rd.npe03__Contact__c){
          rdOld.add(rd);
        }
      }
    }
    if(rdOld.size()>0){
      rdsMap.put(id, rdOld);
    }
  }​
  for(npe03__Recurring_Donation__c rdNew : trigger.new){
       else if(rdNew.npe03__Contact__c != null){
          if(rdsMap.containsKey(rdNew.npe03__Contact__c)){
            List<npe03__Recurring_Donation__c> rdsSort = new List<npe03__Recurring_Donation__c>();
            List<npe03__Recurring_Donation__c> rdsOld = rdsMap.get(rdNew.npe03__Contact__c);//here I get an empty list            
            integer targetsize = rdsOld.size();
                while(rdsSort.size() != targetsize){
                  datetime dt = Datetime.newInstance(1900, 1, 1, 00, 00, 00);
                  integer i = 0;
                  integer mini = 0;
                  for(i = 0; i != rdsOld.size(); i ++){
                      if(rdsOld[i].CreatedDate > dt){
                        dt = rdsOld[i].CreatedDate;
                        mini = i;
                }
              }
                  rdsSort.add(rdsOld[mini]);
                  rdsOld.remove(mini);           
                }
                if(rdsSort[0].npe03__Amount__c < rdNew.npe03__Amount__c){
                  
                }
                else{
                  rdNew.addError('No puede crear un Compromiso de Donación con el Tipo de Compormiso "Nuevo por Aumento", porque el monto ingresado es menor o igual que el monto del Compromiso de Donación Anterior');
                }
          }
        } 
      }
}

 

Hi,

I'm trying to return values from a list in an apex class using the value from another list.
So I have list1 = [Select Contact__r.ContactEmail from Registrations__c Id in : lstRegistrations]

and what I want to do is check all the records from another object using the value of ContactEmail from above list.
So something like this:
list2=[Select Email from Site__c where Email contains (list1.Contact__r.ContactEmail)]

Can this be done?

Any help is much appreciated.

Thanks

We have a milestone that execute a field update, this field update trigger the Case Ater update trigger.
The trigger after update on case use the following function  :  THA_Utils.getProfileIdByName(UserInfo.getUserId());
[...]
public static string getProfileIdByName(Id isUser) {  
List<Profile> listProfile = [Select Name From Profile Where Id in (SELECT ProfileId
                                     FROM User
                                     WHERE id =:idUser)];
                                 return listProfile[0].Name;
 }
We are getting error on the   :  return listProfile[0].Name;   / caused by: System.ListException: List index out of bounds: 0: Class.THA_Utils.getProfileNameByIdUser: line 65, column 1".

Does anyone know why we have this bug ? 
the Default Workflow User is already set up as active admin... I don't udenrstand why we get this error.
I want to send salesforce data to another system, but when I send the data through a batch class when I call the web service in the execute method doesn't execute all the batches, but if in the execute method don't make the callout all the batches execute, I put two counters in the execute method and I am showing in the finish method one for the number of records in the list and the other for the times the execute method is running, and when I execute the batch without make the callouts run all the batches but when execute the batch calling the web service in the execute method don't run all the batches.
I have strange behavior with a APEX Batch job

I run this job with batch size of 1 and it puts a job of 1000 Batches to process. However after it run for some time I have seen following behavior

1. I see the batches are processing fine say like it has processed 300. All of a sudden I see all jobs completed and it says it processed 800 batches (not sure where the other 200 batches go). Looking at the data looks like it did not process everything that should have been processed.

2. Some times I see it is processing fine say at 400th batch and all of a sudden it would say completed with all 1000 batch completed. Looking at the data looks like it did not process everything that should have been processed.

Any ideas why this could happen ?

The batch class internally call another class method in the execute method. This method has some what more logic in it. However this method when run individually does not have any issues (No Heap size issue or other performance issues).  Not sure because of the call method the complete Batch job is abruptly aborted. (with specifying any error)

I have opened a case with Salesforce but want to see if any one else have seen this issue.   
 
I am exporting opportunity data to an excel file xls, but when the query has many data I get this error "Response size exceeded 15MB organization limit", I only use a HTML table, an apex:ouputtext to change the date format and two apex:repeat for the rows, I want to show more than 30,000 records, can some one help me?.

Thanks.
I am exporting opportunity data to an excel file xls, but when the query has many data I get this error "Response size exceeded 15MB organization limit", can some one help me?

Thanks.