• Andrew Echevarria
  • NEWBIE
  • 334 Points
  • Member since 2015
  • Salesforce Developer
  • IBM

  • Chatter
    Feed
  • 11
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 93
    Replies
I have a visualforce page where I select student type of freshman and display highschool information fields (that works fine).  But I want to hide the highschool country if the person checks the homeschooled checkbox.  I can't seem to get that to work. I am trying to use javascript to hide the fields.  Any help would be greatly appreciated.
vfp code:
<apex:page Controller="RFIForm" showHeader="false" standardStylesheets="FALSE">
<apex:includeScript value="{!$Resource.jQuery}"/>
<apex:composition template="{!$Site.Template}">
<apex:define name="body">
<script>
        
$(document).ready(function() {

    HSReRender();
});
    
function HSReRender(){
    var studentType = $("[id$=studentType]").val();
    var HomeSchooled = $("[id$=homeSchooled]").val();
    
    //$(".hsPanelH").hide();
    alert(HomeSchooled);
    if (studentType == "Freshman"){
        $(".highSchoolPanelH").show();
        if (HomeSchooled.checked){
        $(".hsPanelH").hide();
        alert('testing homeschooled checked');}
        else{
        $(".hsPanelH").show();
        alert('testing homeschooled not checked');}
        alert('testing freshman first');
    } else {
        $(".highSchoolPanelH").hide();
        $(".hsPanelH").hide();
        alert('testing freshman else first');
        }
    
    if ($(("#homeSchooled").is(":checked"))){
        //    if (studentType2 == "Freshman" && (HomeSchooled == null || HomeSchooled == false)){
        $(".hsPanelH").hide();
        alert('testing freshman and homeschooled checked');
    } else if (studentType == "Freshman"){
        $(".hsPanelH").show();
        alert('testing just freshman');
        } else {
           $(".hsPanelH").hide();
            alert('testing else');
        }
}
</script>
    <apex:pageMessages ></apex:pageMessages>
<apex:form Id="form">
    <h1 id="page-title">Request for Information </h1>
    <div style="width:100%">
        <p>
           <span class="contentText">Please enter your information in the fields below. When completed click on the <b>Submit</b> button at the bottom of page. Please allow 3 to 5 business days for processing your request for information.</span>
        </p>
        <p>
           <span class="contentText"><strong>* Indicates a required field.</strong></span>
        </p>
    </div>
    <table border="0" cellspacing="3" width="100%">
        <tbody>
            <tr>
                 <th colspan="2">Name and Personal Data</th>
            </tr> 
            <tr>
                <td width="37%"><apex:outputText styleclass="req" value="*Type of Student:"/></td>
                <td width="63%">
                    <apex:selectList id="studentType" value="{!studentType}" multiselect="false" size="1" styleClass="inputRequired" onchange="HSReRender();">
                        <apex:selectOptions value="{!studentTypeOptions}"/>
                        <apex:actionSupport event="onchange" rerender="highSchoolPanel"/> 
                    </apex:selectList>
                </td>
            </tr>
        </tbody>
    </table>
    <table border="0" cellspacing="3" width="100%">
        <tbody>
            <tr class="highSchoolPanelH">
                <th colspan="2" class="highSchoolPanelH">High School Information</th>
            </tr>
            <tr class="highSchoolPanelH">
                <td width="37%" class="highSchoolPanelH">Home Schooled</td>
                <td width="63%" class="highSchoolPanelH" onchange="HSReRender()">
                    <apex:inputCheckbox id="homeSchooled" value="{!interest.Home_Schooled__c}">
                    <apex:actionSupport event="onclick" rerender="highSchoolPanel"/>
                    </apex:inputCheckbox>
                </td>
            </tr>
                
            </tbody> 
        </table>
    <table border="0" cellspacing="3" width="100%" id="highSchoolPanel" rendered="{!studentType=='Freshman' && (interest.Home_Schooled__c==null || interest.Home_Schooled__c==false)}">
        <tbody>
        <tr class="hsPanelH" rendered="{!studentType=='Freshman' && (interest.Home_Schooled__c==null || interest.Home_Schooled__c==false)}">
            <apex:outputText>  
              <td width="37%" class="hsPanelH" >*High School Country</td>
            </apex:outputText>
              <td width="63%" class="hsPanelH" rendered="{!studentType=='Freshman' && (interest.Home_Schooled__c==null || interest.Home_Schooled__c==false)}">
                  <apex:selectList id="hsPanelH" value="{!hscountry}" multiselect="False" size="1" styleClass="inputRequired">
                     <apex:selectOptions value="{!CountryOptions}"/>
                     <apex:actionSupport event="onchange" action="{!getHsStateRequired}" />
                  </apex:selectList>
              </td>
            </tr>
            </tbody>
        </table>
</apex:form>
</apex:define>
</apex:composition>
</apex:page> 
Hi everyone! Does anyone know or familiar with how to create a relationship and functionality that would allow a contact to be related to a contact group directly from the contact record by means of a single field? I would also like to be able to add a single contact to multiple contact groups directly from a field. I've seen this work in other orgs and I am not familiar with how that could be built out.

Alternatively, would I be able to populate a field directly on the contact record with the contact group name once the contact has been added to the said group? 

The purpose for this is to be able to leverage salesforce engage with our already establised contact groups. 

Any advise would be great, thanks! 
Hello,

Does anyone has any experience implementing a Progress Bar with data information within it??

So my requirement is a progress bar which shows when the record was approved, approvers name , and then further steps..

Progress Bar >> Submitted to Govt >> Submitted by Hillary On 10th December >> Approved By Obama On 31st December  >> Submitted to WH >> Submitted By Pence On 20th February >> Rejected by Trump On 21st January ...  :)

Something like that.
Does any one know if this is possible.
And this has to be on display upon page load, and not like an On-click feature.

I know how to create VF progress bar representing percentage and status level, but I haven't ventured in displaying the actual data.
Any and every help will be appreciated.
Thanks! 
Hi All,

I have one custom ( vf page) button for generate quote in opportunity Detail Page. Click this button it generate a custom quote in pdf format.
 In my Scenario, I click that quote button I want to check whether the quote object “IsSyncing"  field is checked or not, If its not checked I want to display one alert for "sync Quote" I am using Professional Edition.
 
Hello,

I have two custom picklist on Account with respective values:
First Picklist
Bussiness Segment: VALUES{PACS, IA, SI}
&
Second Picklist 
Applications : VALUES{ PACS-1, PACS-2, PACS-3, IA-1, IA-2, IA-3,} (No values for Segment SI)

Requirement :
Create VF page which will allow user to select Business segment and show available “Applications” based on the Business Segment using JavaScript.
Also, when no application is available for selected Business segment, then show alert message “Applications not available for business segment: Business Segment name” using JavaScript.

NOTE: Don't want to use any Extension or Custom controller. i.e. need to perform using JavaScript only.

First question: Is it possible through JS only?
Second question: what need to change in below JS code?

Currently, Second Picklist is not re-rendering. 

Please help in this issue.


************************************VF PAGE**********************************************
<apex:page standardController="Account">
<script type="text/javascript">
    function displayChildPickValues(selectPick){
        var pickValue = selectPick.options[selectPick.selectedIndex].value;
        if(pickValue == 'SI')alert('Applications not available for business segment: '+pickValue);
        if(pickValue == 'PACS'){
                   for(var x in document.getElementsByClassName("second")[0].options){
                   var m = document.getElementsByClassName("second")[0].options[x].value;
                   if(!m.startsWith("P")){
                   if(!document.getElementsByClassName("second")[0].options[x].hasAttribute("style"))         
                   document.getElementsByClassName("second")[0].options[x].setAttribute("style","hidden:true;");
                  }//End of IF
                }//End of For
        
    }//End of IF
    
    secondPickFun(); //Calling actionFunction
    
 }//End of javascript function
</script>
  <apex:form >
      <apex:pageblock >
          <apex:pageblockSection >
                 <apex:inputField value="{!Account.Name}"/>
                 <apex:inputField value="{!Account.Business_Segment__c}" onchange="displayChildPickValues(this)">
                  <apex:actionFunction reRender="appPick" name="secondPickFun"/> 
                 </apex:inputField> 
                 <apex:inputField value="{!Account.Applications__c}" Styleclass="second" id="appPick"/> 
          </apex:pageblockSection>
      </apex:pageblock>
  </apex:form>
</apex:page>
 
Hello,
I have been able to populate the record owners "Managers" e-mail on some objects using workflow but on the Case Object I get an error telling me we are out of resources. When I contacted SFDC Support they advised I do this with a Trigger, so I need some help for a newbe (me) trying to write a Trigger.
I have a custom field on the Case object Owners.Managers.eMail__c , I want a trigger that populates the Managers eMail in this field, I also want the Trigger to update the Managers eMail when the Case Owner changes.
below is my trigger, I am trying to update a field  when every a user try to update a state field as 'Michigan' then the Physical COuntry Field should automatically change to 'USA'.  Please tell me where am i doing wrong.
Can i use Update  dml statement for after update trigger. because
Below code is throwing error. 

trigger fUpdate on Financial_Account__c (after update) {
    List<Financial_Account__c> acc = [SELECT Id,name, physical_country__c FROM Financial_Account__c WHERE Id IN: Trigger.newMap.keySet()];
system.debug(''+acc);
    for (Financial_Account__c a : acc) {
If(a.state__c == 'Michigan'){
        a.physical_country__c = 'USA';
}
 
  }
   update acc;
 
   
}

User-added image
 
Hi Experts, 

I need to set up an email notification that will alert me when one of my contacts is turning 40! 

i want it to be SPECIFICALLY 65 days prior to that date. i have an AGE field that has a formula to it of : 

IF(MONTH(TODAY())>MONTH(Birthdate),YEAR(TODAY())-YEAR(Birthdate),IF(AND(MONTH(TODAY())=MONTH(Birthdate),DAY(TODAY())>=DAY(Birthdate)),YEAR(TODAY())-YEAR(Birthdate),(YEAR(TODAY())-YEAR(Birthdate))-1))

That formula brings me back the actual age of the contact from the persons Birthdate.

I know that to set up an email alert you have to do the Workflow and then the Email template. 

But how do i set up an alert to trigger prior to someones birthdate etc. 

Please help
Hi all,

here I am again with the same topic, this time for asking if there is a possibility to fill the field Account automatically at case creation when the email which comes from the Sender coincides with an existing email for that Account?.
For example, supposing Manuel Perez is registered as Account with email address in Salesforce. Manuel Perez sends an email to the Customer Support advocate. Salesforce should work this looking at every Account if there is an account with the email address of the sender, if yes, it should fill the field Account in the case record which is being created.

Is this possible some way?
Hi All,

I am working on a requirement where i am using report ids i.e report ids are hardcoded.
<analytics:reportChart reportId="00O28000006Uvr3" size="small" ></analytics:reportChart>
I need to get remove this hardcoding and get it from select query. How can i accomplish this?

Thanks,
Bharath
 
Hi,

I have a visual force page as shown below in which 'more' is redirect the user to details page of records. but for the block 'Task completed last week' more button is not working, for others it is working fine. any body can help

below is my vf page and controller:-


        <div class="main_container" style="margin-top:10px">
            <div class = "height:50%">
                <div class="animated flipInY col-lg-4 col-md-80 col-sm-80 col-xs-80">
                    <div class="tile-stats">
                        <div style="text-align:center">
                            <apex:outputLabel value="Task Completed Last Week" style="color:#0A31FB;" />
                        </div>
                        <apex:pageBlock >
                         
                            <apex:pageBlockTable value="{!rows}" var="tc" rows="3" rendered="{!rows.size>0}">
                                  
                                <apex:column >

                                    <a href= "/{!tc.id}">
                                    <!--apex:outputLink value="{!URLFOR($Action.CloudbyzITPM__Task__c.View, tc.id)}" styleClass="leftAlign" >-->{!tc.Name}</a>
                                    <!--/apex:outputLink>-->
                            
                                </apex:column>
                              
                            </apex:pageBlockTable>
                            <!-- <apex:repeat>
                                 dsd
                            <apex:outputText value="There are no tasks to display." style="white-space:pre-wrap;border-hidden" />
                            </apex:repeat>-->

                        </apex:pageBlock>
                        <apex:commandButton styleClass="div5" value="more" action="{!redirecttoprjtskcom}"
                        />
                    </div>
            </div>
            </div>
            </div>
   




        <div class="main_container" style="margin-top:10px">
                <div class="animated flipInY col-lg-4 col-md-2 col-sm-6 col-xs-12">
                    <div class="tile-stats">
                        <div style="text-align:center">
                            <apex:outputLabel value="Task In Progress" style="color:#0A31FB;" />
                        </div>
                        <apex:pageBlock >
                            <apex:pageBlockTable value="{!taskname}" var="t" rows="3" rendered="{!taskname.size>0}">
                                <apex:column >
                                    <a href= "/{!t.id}">
                                   <!-- <apex:param name="tcIP" value="{!t.Id}" />
                                    <apex:outputLink value="{!URLFOR($Action.CloudbyzITPM__Task__c.View, t.id)}" styleClass="leftAlign" >-->{!t.Name}</a>
                                    <!--</apex:outputLink>-->
                                </apex:column>
                            </apex:pageBlockTable>
                        </apex:pageBlock>
                        <apex:commandButton styleClass="div5" value="more" action="{!redirecttoprjtskprj}"
                        />
                    </div>
                </div>
            </div>

        <div class="main_container" style="margin-top:10px">
              <div class="row top_tiles" style="text-align:center;">
            <div class="animated flipInY col-lg-4 col-md-2 col-sm-6 col-xs-12">
                <div class="tile-stats">
                    <div style="text-align:center">
                        <apex:outputLabel value="Tasks starting next week" style="color:#0A31FB;" />
                    </div>
                    <apex:pageBlock >
                         <apex:outputPanel layout="block" styleclass="container">

                        <apex:pageBlockTable value="{!taskPlan}" var="tp" rows="3" rendered="{!taskPlan.size>0}">
                            <apex:column >
                                
                                <a href= "/{!tp.id}">
                                <!--<apex:param name="tpId" value="{!tp.Id}" />
                                <apex:outputLink value="{!URLFOR($Action.CloudbyzITPM__Task__c.View, tp.id)}" styleClass="leftAlign" >-->{!tp.Name}</a>
                                <!--</apex:outputLink>-->
                            
                            </apex:column>
                        </apex:pageBlockTable>
                        </apex:outputPanel>
                    </apex:pageBlock>
                    <apex:commandButton styleClass="div5" value="more" action="{!redirecttoprjtskpln}"
                    />
                </div>
            </div>
        </div>
        </div>

Controller:-  

List<CloudbyzITPM__Task__c> taskname =  [SELECT Id,Name, CloudbyzITPM__Status__c FROM  CloudbyzITPM__Task__c WHERE CloudbyzITPM__Status__c = : 'In Progress' and CloudbyzITPM__Project__r.Id =: recordId];
    
   public List<CloudbyzITPM__Task__c> gettaskname(){

if(taskname.size() < 3 ){
     for(integer i = 0; i <= (3 - taskname.size());){
         
          taskname.add(new CloudbyzITPM__Task__c(Name = 'N/A'));
     }
     
 }
   return taskname;
 }  

 public void gettaskinprogress(){
        if (!Schema.sObjectType.CloudbyzITPM__Task__c.isAccessible()||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.id.isAccessible()
               ||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.name.isAccessible()||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.CloudbyzITPM__Milestone__c.isAccessible()
               ||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.CloudbyzITPM__Planned_Start_Date__c.isAccessible()||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.CloudbyzITPM__Planned_End_Date__c.isAccessible()
                ||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.CloudbyzITPM__Actual_End_Date__c.isAccessible()||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.CloudbyzITPM__Actual_Start_date__c.isAccessible())
                 {
                  ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL,
                                      'Insufficient access'));
                 return;
                 }
       if(currentProjectId!=null)
       currentProjectId=string.escapeSingleQuotes(currentProjectId);
       lstoftasksPrg =  [SELECT Id,Name, CloudbyzITPM__Status__c,CloudbyzITPM__Milestone__c,CloudbyzITPM__Planned_Start_Date__c,CloudbyzITPM__Planned_End_Date__c,CloudbyzITPM__Actual_Start_date__c,CloudbyzITPM__Actual_End_Date__c FROM  CloudbyzITPM__Task__c WHERE CloudbyzITPM__Status__c = : 'In Progress' and CloudbyzITPM__Project__r.Id =: recordId];   

    } 
public List<CloudbyzITPM__Task__c> getlstoftasksPrg(){
    
    return lstoftasksPrg;
}   

  public pagereference redirecttoprjtskprj(){
        return new pagereference('/apex/projecttaskprogress?id='+currentProjectId);
    }




/* task in completed 
  List<CloudbyzITPM__Task__c> taskComp =  [SELECT Id,Name, CloudbyzITPM__Actual_End_Date__c, CloudbyzITPM__Status__c FROM  CloudbyzITPM__Task__c WHERE CloudbyzITPM__Status__c = : 'Completed' and CloudbyzITPM__Actual_End_Date__c >=:system.today().toStartOfWeek().addDays(-7)
 and CloudbyzITPM__Actual_End_Date__c <=:system.today().toStartOfWeek().addDays(-1) and CloudbyzITPM__Project__r.Id =: recordId];
 
 public list<CloudbyzITPM__Task__c> getRows()
 {   
 List<CloudbyzITPM__Task__c> rows =  [SELECT Id,Name, CloudbyzITPM__Actual_End_Date__c, CloudbyzITPM__Status__c FROM  CloudbyzITPM__Task__c WHERE CloudbyzITPM__Status__c = : 'Completed' and CloudbyzITPM__Actual_End_Date__c >=:system.today().toStartOfWeek().addDays(-7)
 and CloudbyzITPM__Actual_End_Date__c <=:system.today().toStartOfWeek().addDays(-1) and CloudbyzITPM__Project__r.Id =: recordId ];
 
 system.debug('@@ rows of task' + rows);
 List<CloudbyzITPM__Task__c> rows_temp = new List<CloudbyzITPM__Task__c>(rows);
 rows.clear();
 for(CloudbyzITPM__Task__c irrTask : rows_temp)
 {
     
 if(irrTask.Name.length()>10) 
 { 
     system.debug('@@ rows of task' + rows);
      irrTask.Name = irrTask.Name.substring(0,10) + '...' ; 
 } 
 rows.add(irrTask);       
 
 } 
(rows.size() < 3 ){
     for(integer i = 0; i <= (3 - rows.size());){
         rows.add(new CloudbyzITPM__Task__c(Name = 'N/A'));
     }
 }
    return rows;  
 }
public void gettaskcompleted(){
    System.debug('@@lstoftaskscmp@@');
        if (!Schema.sObjectType.CloudbyzITPM__Task__c.isAccessible()||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.id.isAccessible()
               ||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.name.isAccessible()||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.CloudbyzITPM__Milestone__c.isAccessible()
               ||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.CloudbyzITPM__Planned_Start_Date__c.isAccessible()||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.CloudbyzITPM__Planned_End_Date__c.isAccessible()
                ||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.CloudbyzITPM__Actual_End_Date__c.isAccessible()||!Schema.sObjectType.CloudbyzITPM__Task__c.fields.CloudbyzITPM__Actual_Start_date__c.isAccessible())
              {
                 
                 ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL,
                                      'Insufficient access'));
                 return;
                 }
                 System.debug('@@currentProjectId@@'+currentProjectId);
    
       if(currentProjectId!=null)
       currentProjectId=string.escapeSingleQuotes(currentProjectId);
       lstoftaskscmp =   [SELECT Id,Name, CloudbyzITPM__Actual_End_Date__c,CloudbyzITPM__Milestone__c,CloudbyzITPM__Planned_Start_Date__c,CloudbyzITPM__Planned_End_Date__c ,CloudbyzITPM__Actual_Start_date__c,CloudbyzITPM__Status__c FROM  CloudbyzITPM__Task__c WHERE CloudbyzITPM__Status__c = : 'Completed' and CloudbyzITPM__Actual_End_Date__c >=:system.today().toStartOfWeek().addDays(-7)
 and CloudbyzITPM__Actual_End_Date__c <=:system.today().toStartOfWeek().addDays(-1) and CloudbyzITPM__Project__r.Id =: recordId];
    
    } 
public List<CloudbyzITPM__Task__c> getlstoftaskscmp()
{
    System.debug('@@lstoftaskscmp@@'+lstoftaskscmp);
    return lstoftaskscmp;
}   

  public pagereference redirecttoprjtskcom()
  {
        return new pagereference('/apex/projecttaskcomplete?id='+currentProjectId);
    }


   
triggers to share opportunity line items salesforce to salesforce