• DannyK89
  • NEWBIE
  • 445 Points
  • Member since 2011

  • Chatter
    Feed
  • 17
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 115
    Questions
  • 128
    Replies

hi all,

 

i have question ?

 

how can we send an email with our file attachment  to desired email address ?

 

like gmail and yahoo i want the same kind of page......

 

any kind of help will be gratly appriciated..........

 

thanks in advance........

 

Vishal Thoriya.

Hi everyone,

 

So I am getting the hand of apex methods being called remote from javascript.

Of course I am having some issues. I have put a temparary method in my apex class that I want to be called from some javascript in the visual force page.

However it seems that I have a bug somewhere because the javascript does not run. 

I have been looking at this code for i'm guessing a couple of hours and can't see what is wrong. 

Maybe someone on here can give me a hand.

 

Visualforce Javascript / code:

 

<apex:page controller="AMManagementController">
<script>
        function switchMenu(obj,obj1,obj2) 
        {
            var el = document.getElementById(obj);                                       
            if ( el.style.display != 'none' ) {
            el.style.display = 'none';
            }
            else {
            el.style.display = '';
            }
            var e2 = document.getElementById(obj1);                                       
            if ( e2.style.display != 'none' ) {
            e2.style.display = 'none';
            }
            else {
            e2.style.display = '';
            }
             var e3 = document.getElementById(obj2);                                       
            if ( e2.style.display != 'none' ) {
            e3.style.display = 'none';
            }
            else {
            e3.style.display = '';
            }

        }
        
        function CheckUpdate(){
            AMManagementController.UpdateCheck('Update',function(result, event){
                if(result == false)
                    alert('Are you sure you want to do this?');
            },{escape: true});
        }
</script>
<apex:form >
<apex:pageBlock tabStyle="Account" title="Requirement Management">
    <apex:pageBlockButtons >
        <apex:commandButton value="Back" onclick="CheckUpdate();"/>

 

Apex method trying to call:

 

global class AMManagementController {

public AMManagementController(){}

@RemoteAction
    global static boolean UpdateCheck(String test){
        return true;
    }

}

 

Hi Everyone,

 

I am having a problem with some code I am trying to write. I want to create a calculator inside salesforce. When I try to add a output text tag with a variable in it I keep getting the unknown property error.

The variable is defined in my custom apex controller. IT has a getter and setter methods and is set to public. I don't understand what the problem is?

Can someone help me out. 

 

Below is my code that I have created so far:

 

Visualforce page:

<apex:page controller="DirectHireCalcController">
<apex:form >
<apex:page >
    <apex:pageBlock title="Direct Hire Fee Calculator">
        <apex:pageBlockSection columns="1">
            <apex:pageBlockSectionItem helpText="This value is automatically calculated. Do not enter a value.">
                <apex:outputLabel value="Direct Hire Fee"/>
                <apex:outputPanel id="DirectHireFee">
                    <input type="text" value="" readonly="readonly" style="color:black; font-weight:bold; border:1px solid #AEAEAE; background-color:white;"/>
                    <!--<apex:inputText label="Gross Margin Pct" value="{!GrossPctString}" disabled="true" style="color:black; font-weight:bold; border:1px solid #AEAEAE; background-color:white;"/>-->
                </apex:outputPanel>
            </apex:pageBlockSectionItem>
            <apex:outputText >
                {!DHPercent}
            </apex:outputText>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
</apex:form>
</apex:page>

Controller:

public class DirectHireCalcController {
    public String DHFee {get; set;}
    public String DHPercent {get; set;}
    public DirectHireCalcController(){}
}

 

 

Thanks,

Hi Everyone,

 

I was trying to clone some reports using the force.com IDE. I came across a joined report in my force.com IDE. I cloned it. It seemed to save fine but when I tried to look at it in salesforce it gave me an error. 

 

Is it possible that I did something wrong?

 

 

Error: An internal server error has occurred

An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience. 

Thank you again for your patience and assistance. And thanks for using salesforce.com!
 
 

Hi everyone,

 

I would like to show the values of each bar on the bar chart I created at the top of the bar chart like a report. However I am having trouble figuring out how to do that. I would appreciate the help. 

 

Thank,

I am trying to put an inputText field that is disabled on a visualforce page. I have put some style attributes on the field that make it look like a regulart inputText field on google chrome and fireFox. I wanted the fields to have bolded Text and have a white background. The style attributes worked on chrome and firefox but not IE. When I Enable the inputText field the text is bolded. I would like to have it where the text is bolded and the inputText field is disabled. Can someone please help me out.

 

Thanks,

 

<apex:inputText label="Gross Margin" disabled="true" value="{!GrossString}" style="color:black; font-weight:bold; border:1px solid #AEAEAE; background-color:white;"/>

 

Hi everyone,

 

So, I was working on a visualforce page. I would like to know if there is a way to prevent the first Page Block Button from running when you press the enter key. I would like the enter key to run another function in my controller. If you need anything more from me please let me know.

 

** Visualforce code:

<apex:page controller="CalcController">
<apex:form id="form">
    <apex:pageBlock title="Margin Calculator" id="page">
        <apex:pageBlockButtons >
            <apex:commandButton value="Back" action="/home/home.jsp"/>
            <apex:commandButton value="Calculate" id="test"/>
        </apex:pageBlockButtons>
        <apex:messages style="font-size:16px; color:red;" id="error"/>
        <apex:pageBlockSection columns="1" id="Main">
            <!--<apex:inputField />-->
            <apex:selectList value="{!Type}" size="1" label="Pay Status">
                <apex:selectOption itemLabel="W2-Hourly" itemValue="W2-Hourly"/>
                <apex:selectOption itemLabel="Corp-Empl" itemValue="Corp-Empl"/>
                <apex:selectOption itemLabel="Corp-Prin" itemValue="Corp-Prin"/>
                <apex:selectOption itemLabel="SS-1099" itemValue="SS-1099"/>
                <apex:selectOption itemLabel="Salary" itemValue="Salary"/>
                <apex:actionSupport event="onchange" action="{!Calculate}" reRender="page"/>
            </apex:selectList>
            <apex:inputText label="Pay Rate" value="{!PayRate}" onkeypress="return noenter();">
            </apex:inputText>
            <apex:inputText label="Bill Rate" value="{!BillRate}">
                <apex:actionSupport event="onchange" action="{!Calculate}" reRender="page"/>
            </apex:inputText>
            <apex:inputText label="Discount Percent" value="{!DiscountPercent}">
                <apex:actionSupport event="onchange" action="{!Calculate}" reRender="page"/>
            </apex:inputText>
            <apex:pageBlockSectionItem >
                <apex:outputLabel />
                <apex:commandButton value="Clear" action="{!Clear}"/>
            </apex:pageBlockSectionItem>
        <!--<apex:inputText label="Gross Margin" value="{!GrossMargin}"/>
            <apex:inputText label="Gross Margin Pct" value="{!GrossMarginPct}"/>-->
            <apex:outputText label="Gross Margin" value="${!GrossMargin}"/>
            <apex:outputText label="Gross Margin Pct" value="{!GrossMarginPct}%"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>

** Controller Code:

public class CalcController {
    public String Type             { get; set; }
    public Decimal BillRate        { get; set; }
    public Decimal PayRate         { get; set; }
    public Decimal DiscountPercent { get; set; }
    public Decimal GrossMargin     { get; set; }
    public Decimal GrossMarginPct  { get; set; }
    public CalcController(){
        
    }
    public void Calculate(){
        if(DiscountPercent == null)
            DiscountPercent = 0;
        if(Type=='Corp-Empl' || Type=='Corp-Prin' || Type=='SS-1099'){
            if(BillRate != null && PayRate != null && BillRate != 0 && PayRate != 0){   
                GrossMargin = BillRate - PayRate - (PayRate*0.03) - (BillRate*(DiscountPercent/100));
                GrossMarginPct = 100*(GrossMargin / (BillRate - (BillRate * (DiscountPercent/100))));
                GrossMargin = GrossMargin.setScale(2, System.RoundingMode.HALF_UP);
                GrossMarginPct = GrossMarginPct.setScale(2, System.RoundingMode.HALF_UP);
            }
            else{
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'ERROR: Please enter the Bill Rate and Pay Rate');
                ApexPages.addMessage(myMsg);
            }
            /*if(GrossMargin != null && GrossmarginPct != null && GrossMargin != 0 && GrossMarginPct != 0){
                BillRate = (GrossMargin/(GrossMarginPct/100));
                BillRate += (BillRate*(DiscountPercent/100));
                PayRate = ((GrossMargin - BillRate + (BillRate*(DiscountPercent/100)))/-1.03);
                BillRate = BillRate.setScale(2, System.RoundingMode.HALF_UP);
                PayRate = PayRate.setScale(2, System.RoundingMode.HALF_UP);
            }
            else if(BillRate != null && PayRate != null && BillRate != 0 && PayRate != 0){   
                GrossMargin = BillRate - PayRate - (PayRate*0.03) - (BillRate*(DiscountPercent/100));
                GrossMarginPct = 100*(GrossMargin / (BillRate - (BillRate * (DiscountPercent/100))));
            }
            else{
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'ERROR: Please enter the Bill Rate and Pay Rate or Gross Margin and Gross Margin Pct');
                ApexPages.addMessage(myMsg);
            }*/
        }
        else if(Type=='Salary'){
            if(BillRate != null && PayRate != null && BillRate != 0 && PayRate != 0){   
                GrossMargin = BillRate - PayRate - (PayRate*0.25) - (BillRate*(DiscountPercent/100));
                GrossMarginPct = 100*(GrossMargin / (BillRate - (BillRate * (DiscountPercent/100))));
                GrossMargin = GrossMargin.setScale(2, System.RoundingMode.HALF_UP);
                GrossMarginPct = GrossMarginPct.setScale(2, System.RoundingMode.HALF_UP);
            }
            else{
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'ERROR: Please enter the Bill Rate and Pay Rate');
                ApexPages.addMessage(myMsg);
            }
            /*if(GrossMargin != null && GrossMarginPct != null && GrossMargin != 0 && GrossMarginPct != 0){
                BillRate = (GrossMargin/(GrossMarginPct/100));
                BillRate += (BillRate*(DiscountPercent/100));
                PayRate = ((GrossMargin - BillRate + (BillRate*(DiscountPercent/100)))/-1.25);
                BillRate = BillRate.setScale(2, System.RoundingMode.HALF_UP);
                PayRate = PayRate.setScale(2, System.RoundingMode.HALF_UP);
            }
            else if(BillRate != null && PayRate != null && BillRate != 0 && PayRate != 0){
                GrossMargin = BillRate - PayRate - (PayRate*0.25) - (BillRate*(DiscountPercent/100));
                GrossMarginPct = 100*(GrossMargin / (BillRate - (BillRate * (DiscountPercent/100))));
            }
            else{
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'ERROR: Please enter the Bill Rate and Pay Rate or Gross Margin and Gross Margin Pct');
                ApexPages.addMessage(myMsg);
            }*/
        }
        else if(Type=='W2-Hourly'){
            if(BillRate != null && PayRate != null && BillRate != 0 && PayRate != 0){   
                GrossMargin = BillRate - PayRate - (PayRate*0.15) - (BillRate*(DiscountPercent/100));
                GrossMarginPct = 100*(GrossMargin / (BillRate - (BillRate * (DiscountPercent/100))));
                GrossMargin = GrossMargin.setScale(2, System.RoundingMode.HALF_UP);
                GrossMarginPct = GrossMarginPct.setScale(2, System.RoundingMode.HALF_UP);
            }
            else{
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'ERROR: Please enter the Bill Rate and Pay Rate');
                ApexPages.addMessage(myMsg);
            }
            /*if(GrossMargin != null && GrossMarginPct != null && GrossMargin != 0 && GrossMarginPct != 0){
                BillRate = (GrossMargin/(GrossMarginPct/100));
                BillRate += (BillRate*(DiscountPercent/100));
                PayRate = ((GrossMargin - BillRate + (BillRate*(DiscountPercent/100)))/-1.15);
                BillRate = BillRate.setScale(2, System.RoundingMode.HALF_UP);
                PayRate = PayRate.setScale(2, System.RoundingMode.HALF_UP);
            }
            else if(BillRate != null && PayRate != null && BillRate != 0 && PayRate != 0){
                GrossMargin = BillRate - PayRate - (PayRate*0.15) - (BillRate*(DiscountPercent/100));
                GrossMarginPct = 100*(GrossMargin / (BillRate - (BillRate * (DiscountPercent/100))));
            }
            else{
                ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, 'ERROR: Please enter the Bill Rate and Pay Rate or Gross Margin and Gross Margin Pct');
                ApexPages.addMessage(myMsg);
            }*/
        }
    }
    public void Clear(){
        BillRate = PayRate = DiscountPercent = GrossMargin = GrossMarginPct = 0;
    }
    
    static testMethod void TestController(){
        CalcController controller = new CalcController();
        controller.Type ='Corp-Prin';
        controller.PayRate = 35.00;
        controller.BillRate = 55.00;
        controller.DiscountPercent = 0.00;
        controller.Calculate();
        controller.Type ='Corp-Prin';
        controller.PayRate = 0.00;
        controller.BillRate = 0.00;
        controller.DiscountPercent = 0.00;
        controller.Calculate();
        controller.Type ='Salary';
        controller.PayRate = 35.00;
        controller.BillRate = 55.00;
        controller.DiscountPercent = 0.00;
        controller.Calculate();
        controller.Type ='Salary';
        controller.PayRate = 0.00;
        controller.BillRate = 0.00;
        controller.DiscountPercent = 0.00;
        controller.Calculate();
        controller.Type ='W2-Hourly';
        controller.PayRate = 35.00;
        controller.BillRate = 55.00;
        controller.DiscountPercent = 0.00;
        controller.Calculate();
        controller.Type ='W2-Hourly';
        controller.PayRate = 0.00;
        controller.BillRate = 0.00;
        controller.DiscountPercent = 0.00;
        controller.Calculate();
        controller.Clear();
    }
}

 

I am working with visualforce charting. I have bars series that show information. I would like the bars on the chart to be grouped by name and for the bars to be side by side.

If you need anymore information from me please let me know.

 

<!-- Visualforce page: -->

<apex:page controller="ChartController">
<apex:form >
<apex:pageBlock >
    <apex:pageBlockSection columns="1">
        <apex:chart height="400" width="700" data="{!data}" >
            <apex:legend position="right"/>
            <apex:axis type="Numeric" position="right" fields="data1"  title="Revenue (millions)" grid="true"/>
            <apex:axis type="Category" position="bottom" fields="name"  title="Month of the Year">
                <apex:chartLabel rotate="315"/>
            </apex:axis>
            <apex:barSeries title="Data1" orientation="vertical" axis="right"  xField="name" yField="data1" colorSet="red" stacked="false">
                <apex:chartTips height="20" width="120"/>
            </apex:barSeries>
            <apex:barSeries title="Data2" orientation="vertical" axis="right"  xField="name" yField="data2" colorSet="green" stacked="false">
                <apex:chartTips height="20" width="120"/>
            </apex:barSeries>
            <apex:barSeries title="Data3" orientation="vertical" axis="right"  xField="name" yField="data3" stacked="false">
                <apex:chartTips height="20" width="120" />
            </apex:barSeries>
        </apex:chart>
    </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

<!-- Controller Code: -->

public class ChartController {
    // Return a list of data points for a chart 
    
    public List<Data> getData() {
        return ChartController.getChartData();
    }
    
    // Make the chart data available via JavaScript remoting 
    
    @RemoteAction
    public static List<Data> getRemoteData() {
        return ChartController.getChartData();
    }

    // The actual chart data; needs to be static to be 
    
    // called by a @RemoteAction method 
    
    public static List<Data> getChartData() {
        List<Data> data = new List<Data>();
        data.add(new Data('Jan', 30, 90, 55));
        data.add(new Data('Feb', 44, 15, 65));
        data.add(new Data('Mar', 25, 32, 75));
        data.add(new Data('Apr', 74, 28, 85));
        data.add(new Data('May', 65, 51, 95));
        data.add(new Data('Jun', 33, 45, 99));
        data.add(new Data('Jul', 92, 82, 35));
        data.add(new Data('Aug', 87, 73, 45));
        data.add(new Data('Sep', 34, 65, 55));
        data.add(new Data('Oct', 78, 66, 56));
        data.add(new Data('Nov', 80, 67, 53));
        data.add(new Data('Dec', 17, 70, 70));
        return data;
    }
    
    // Wrapper class 
    
    public class Data {
        public String name { get; set; }
        public Integer data1 { get; set; }
        public Integer data2 { get; set; }
        public Integer data3 { get; set; }
        public Data(String name, Integer data1, Integer data2, Integer data3) {
            this.name = name;
            this.data1 = data1;
            this.data2 = data2;
            this.data3 = data3;
        }
    }
}

 

I would like to know how the embed a community inside a force.com public site. I would like users to be able to have a community to go to if they have questions instead of filing a case with the service team.

 

Thanks.

Hi everyone,

 

I would like to know if there is a way to check if a user is using a mobile device or computer when accessing a visualforce page.

I would like mobile users to see certain fields and comptuer users to see certain fields.

So I am update a Rich Text field with a Workflow rule field update. I would like the new value of another field to be put at the top of the Rich Text field. However evertime I try to do that the old rich text field data looses all of it's rich text attributes. Is there anything that I can do to fix that. My formula is bellow. If you see any issues let me know.

 

'('&TEXT(MONTH(DATEVALUE(NOW()))) + "/" + TEXT(DAY(DATEVALUE(NOW()))) + "/" + TEXT(YEAR(DATEVALUE(NOW()))) + ' ' + IF(VALUE(MID(TEXT(LastModifiedDate),12,2)) <= 16, LEFT(RIGHT(TEXT((LastModifiedDate - (5/24))), 10),6),LEFT(RIGHT(TEXT((LastModifiedDate - (17/24))), 10),6) ) + IF(VALUE(MID(TEXT(LastModifiedDate),12,2)) <= 16, " AM", " PM") + ' ' +') '+ '<b>Solving IT Feedback: </b>'+Feed_Back__c+"<br/><br/>"+ PRIORVALUE( Partner_FB__c )

 

I have been trying and searching for a while and I can't seem to find a way to display the Time specificly the hour and minutes from and Date time field. I would like to display the Hour and Minute from the NOW() function in salesforce formula editor. If anyone can give me some tips that would be great. Thanks.

I have a Visualforce page in a page layout. I would like to have the Visualforce page to change it's height automaticly so I don't have to scroll. Is that something that can be done?

Ok so I have been working on a custom public site. Everything on the site is working fine until I try to open a popup window from the visuaforce page. When I do that on certain browsers Like IE i get a warning message.

 

The message reads:

 

To display the webpage again, the web browser needs to resend the information you've previously submitted. If you were making a purchase, you should click Cancel to avoid a duplicate transaction. Otherwise, click Retry to display the webpage again.

 

Is there any way to stop this warning from appearing when I have a popup window open?

I am creating an email template. I would like the email template to show the first name of a contact attached to a custom object I build. I have tried this: {!Object__c.Contact__c.FirstName} but it shows up as a blank on the email. Is it possible to show just the first name of the contact related to the custom object. Thank. 

I would like to change the color of one of my pageblocksections. Below is just a sample if what I would like to do. I would like to change the color of the first pageblocksection. I would like to know if this is possible or not. 

 

Thanks. 

<apex:page>
<apex:form>
    <apex:pageblock>
        <apex:pageBlockSection>
            <apex:pageBlockSection>
            </apex:pageBlockSection>
            <apex:pageBlockSection>
            </apex:pageBlockSection>
        </apex:pageBlockSection>
    </apex:pageblock>
</apex:form>
<apex:page>

 

I am having some issues that I need some help with.

 

I have a page with a field set on it that is part of a repeat tag. I want the look up field to auto populate with the users first and last name. I have found a way to populate the look up but it can't be part of the repeat tag. I am not sure what the problem is. 

 

Visualforce code:

 

<apex:page standardController="Account" showHeader="false">
 <script type="text/javascript" charset="utf-8" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>  
 <script type="text/javascript" charset="utf-8" src="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.js"></script>
  <apex:form id="AccountForm">
      <apex:pageBlock id="AccountBlock">
      <apex:pageBlockSection id="AccountSection">
          <apex:inputField id="Contact" value="{!Account.Contact_Test__c}" rendered="true"/>
          <apex:repeat id="FieldList" value="{!$ObjectType.Account.FieldSets.test}" var="set">
              <apex:inputField id="ContactLookup" value="{!Account[set]}" rendered="{!CONTAINS(LOWER(set), LOWER('Contact_Test__c'))}"/>
              <apex:inputField value="{!Account[set]}" rendered="{!NOT(CONTAINS(LOWER(set), LOWER('Contact_Test__c')))}"/>
          </apex:repeat>
      </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
<script type="text/javascript">
  try
  {
    var form = document.getElementsByTagName("FORM");
    var formid= '#' + form[0].id.replace(/:/g, "\\:");
    $(formid+"\\:AccountBlock\\:AccountSection\\:Contact").val('{!$User.FirstName} {!$User.LastName}');
  }
  catch(err)
  {
    alert(err);
  }
</script>
</apex:page>

 

I am working with a custom object that has a look up field. I was wondering if it is possible to plug in a partail name into the look up field and then search using the look up field. I know I can type the name into the look up and that works but I would like to auto fill the lookup field with a partail name. Im not sure if this is possible and would like some guidence. Thanks.

I have implemented the recaptcha in my site. However I am running into an issue. The issue is not that major and I can live with it but I would like some help fixing it. My issue is that when I come to the page with the recaptcha on it the focus of the page is the response field for the recaptcha. I would like it to be the first field on the page. I followed the help on this article:

 

http://wiki.developerforce.com/page/Adding_CAPTCHA_to_Force.com_Sites

 

Is there any way to make the focus go off of the recaptcha and onto the first field?

I have built a cutom visualforce page. This visualforce page has field sets that it uses. I would like to display the help text for the fields as outputText on the visualforce page. I found the Describe Field Result Methods but I can't find a way to use them. I was wondering if someone could give me a hand figureing it out or pointing me in the right direction. Thanks.

Ok so I was doing some research on triggers and found  something called Trigger Context Variables. In there I found something called isExecuting. I was wondering if I put that in a if statement around all my trigger code with it only run if a user in my org makes a change that causes the trigger to fire. For example if I pull Leads from Data.com with the trigger code fire?

 

Sample Code:

 

Trigger TestTrigger on Lead (after insert){
   if(Trigger.isExecuting){
      // Trigger code
   }
{

 


I am working with visualforce charting. I have bars series that show information. I would like the bars on the chart to be grouped by name and for the bars to be side by side.

If you need anymore information from me please let me know.

 

<!-- Visualforce page: -->

<apex:page controller="ChartController">
<apex:form >
<apex:pageBlock >
    <apex:pageBlockSection columns="1">
        <apex:chart height="400" width="700" data="{!data}" >
            <apex:legend position="right"/>
            <apex:axis type="Numeric" position="right" fields="data1"  title="Revenue (millions)" grid="true"/>
            <apex:axis type="Category" position="bottom" fields="name"  title="Month of the Year">
                <apex:chartLabel rotate="315"/>
            </apex:axis>
            <apex:barSeries title="Data1" orientation="vertical" axis="right"  xField="name" yField="data1" colorSet="red" stacked="false">
                <apex:chartTips height="20" width="120"/>
            </apex:barSeries>
            <apex:barSeries title="Data2" orientation="vertical" axis="right"  xField="name" yField="data2" colorSet="green" stacked="false">
                <apex:chartTips height="20" width="120"/>
            </apex:barSeries>
            <apex:barSeries title="Data3" orientation="vertical" axis="right"  xField="name" yField="data3" stacked="false">
                <apex:chartTips height="20" width="120" />
            </apex:barSeries>
        </apex:chart>
    </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

<!-- Controller Code: -->

public class ChartController {
    // Return a list of data points for a chart 
    
    public List<Data> getData() {
        return ChartController.getChartData();
    }
    
    // Make the chart data available via JavaScript remoting 
    
    @RemoteAction
    public static List<Data> getRemoteData() {
        return ChartController.getChartData();
    }

    // The actual chart data; needs to be static to be 
    
    // called by a @RemoteAction method 
    
    public static List<Data> getChartData() {
        List<Data> data = new List<Data>();
        data.add(new Data('Jan', 30, 90, 55));
        data.add(new Data('Feb', 44, 15, 65));
        data.add(new Data('Mar', 25, 32, 75));
        data.add(new Data('Apr', 74, 28, 85));
        data.add(new Data('May', 65, 51, 95));
        data.add(new Data('Jun', 33, 45, 99));
        data.add(new Data('Jul', 92, 82, 35));
        data.add(new Data('Aug', 87, 73, 45));
        data.add(new Data('Sep', 34, 65, 55));
        data.add(new Data('Oct', 78, 66, 56));
        data.add(new Data('Nov', 80, 67, 53));
        data.add(new Data('Dec', 17, 70, 70));
        return data;
    }
    
    // Wrapper class 
    
    public class Data {
        public String name { get; set; }
        public Integer data1 { get; set; }
        public Integer data2 { get; set; }
        public Integer data3 { get; set; }
        public Data(String name, Integer data1, Integer data2, Integer data3) {
            this.name = name;
            this.data1 = data1;
            this.data2 = data2;
            this.data3 = data3;
        }
    }
}

 

Hi everyone,

 

So I am getting the hand of apex methods being called remote from javascript.

Of course I am having some issues. I have put a temparary method in my apex class that I want to be called from some javascript in the visual force page.

However it seems that I have a bug somewhere because the javascript does not run. 

I have been looking at this code for i'm guessing a couple of hours and can't see what is wrong. 

Maybe someone on here can give me a hand.

 

Visualforce Javascript / code:

 

<apex:page controller="AMManagementController">
<script>
        function switchMenu(obj,obj1,obj2) 
        {
            var el = document.getElementById(obj);                                       
            if ( el.style.display != 'none' ) {
            el.style.display = 'none';
            }
            else {
            el.style.display = '';
            }
            var e2 = document.getElementById(obj1);                                       
            if ( e2.style.display != 'none' ) {
            e2.style.display = 'none';
            }
            else {
            e2.style.display = '';
            }
             var e3 = document.getElementById(obj2);                                       
            if ( e2.style.display != 'none' ) {
            e3.style.display = 'none';
            }
            else {
            e3.style.display = '';
            }

        }
        
        function CheckUpdate(){
            AMManagementController.UpdateCheck('Update',function(result, event){
                if(result == false)
                    alert('Are you sure you want to do this?');
            },{escape: true});
        }
</script>
<apex:form >
<apex:pageBlock tabStyle="Account" title="Requirement Management">
    <apex:pageBlockButtons >
        <apex:commandButton value="Back" onclick="CheckUpdate();"/>

 

Apex method trying to call:

 

global class AMManagementController {

public AMManagementController(){}

@RemoteAction
    global static boolean UpdateCheck(String test){
        return true;
    }

}

 

Hi Everyone,

 

I am having a problem with some code I am trying to write. I want to create a calculator inside salesforce. When I try to add a output text tag with a variable in it I keep getting the unknown property error.

The variable is defined in my custom apex controller. IT has a getter and setter methods and is set to public. I don't understand what the problem is?

Can someone help me out. 

 

Below is my code that I have created so far:

 

Visualforce page:

<apex:page controller="DirectHireCalcController">
<apex:form >
<apex:page >
    <apex:pageBlock title="Direct Hire Fee Calculator">
        <apex:pageBlockSection columns="1">
            <apex:pageBlockSectionItem helpText="This value is automatically calculated. Do not enter a value.">
                <apex:outputLabel value="Direct Hire Fee"/>
                <apex:outputPanel id="DirectHireFee">
                    <input type="text" value="" readonly="readonly" style="color:black; font-weight:bold; border:1px solid #AEAEAE; background-color:white;"/>
                    <!--<apex:inputText label="Gross Margin Pct" value="{!GrossPctString}" disabled="true" style="color:black; font-weight:bold; border:1px solid #AEAEAE; background-color:white;"/>-->
                </apex:outputPanel>
            </apex:pageBlockSectionItem>
            <apex:outputText >
                {!DHPercent}
            </apex:outputText>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>
</apex:form>
</apex:page>

Controller:

public class DirectHireCalcController {
    public String DHFee {get; set;}
    public String DHPercent {get; set;}
    public DirectHireCalcController(){}
}

 

 

Thanks,

I am trying to put an inputText field that is disabled on a visualforce page. I have put some style attributes on the field that make it look like a regulart inputText field on google chrome and fireFox. I wanted the fields to have bolded Text and have a white background. The style attributes worked on chrome and firefox but not IE. When I Enable the inputText field the text is bolded. I would like to have it where the text is bolded and the inputText field is disabled. Can someone please help me out.

 

Thanks,

 

<apex:inputText label="Gross Margin" disabled="true" value="{!GrossString}" style="color:black; font-weight:bold; border:1px solid #AEAEAE; background-color:white;"/>

 

I am working with visualforce charting. I have bars series that show information. I would like the bars on the chart to be grouped by name and for the bars to be side by side.

If you need anymore information from me please let me know.

 

<!-- Visualforce page: -->

<apex:page controller="ChartController">
<apex:form >
<apex:pageBlock >
    <apex:pageBlockSection columns="1">
        <apex:chart height="400" width="700" data="{!data}" >
            <apex:legend position="right"/>
            <apex:axis type="Numeric" position="right" fields="data1"  title="Revenue (millions)" grid="true"/>
            <apex:axis type="Category" position="bottom" fields="name"  title="Month of the Year">
                <apex:chartLabel rotate="315"/>
            </apex:axis>
            <apex:barSeries title="Data1" orientation="vertical" axis="right"  xField="name" yField="data1" colorSet="red" stacked="false">
                <apex:chartTips height="20" width="120"/>
            </apex:barSeries>
            <apex:barSeries title="Data2" orientation="vertical" axis="right"  xField="name" yField="data2" colorSet="green" stacked="false">
                <apex:chartTips height="20" width="120"/>
            </apex:barSeries>
            <apex:barSeries title="Data3" orientation="vertical" axis="right"  xField="name" yField="data3" stacked="false">
                <apex:chartTips height="20" width="120" />
            </apex:barSeries>
        </apex:chart>
    </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

<!-- Controller Code: -->

public class ChartController {
    // Return a list of data points for a chart 
    
    public List<Data> getData() {
        return ChartController.getChartData();
    }
    
    // Make the chart data available via JavaScript remoting 
    
    @RemoteAction
    public static List<Data> getRemoteData() {
        return ChartController.getChartData();
    }

    // The actual chart data; needs to be static to be 
    
    // called by a @RemoteAction method 
    
    public static List<Data> getChartData() {
        List<Data> data = new List<Data>();
        data.add(new Data('Jan', 30, 90, 55));
        data.add(new Data('Feb', 44, 15, 65));
        data.add(new Data('Mar', 25, 32, 75));
        data.add(new Data('Apr', 74, 28, 85));
        data.add(new Data('May', 65, 51, 95));
        data.add(new Data('Jun', 33, 45, 99));
        data.add(new Data('Jul', 92, 82, 35));
        data.add(new Data('Aug', 87, 73, 45));
        data.add(new Data('Sep', 34, 65, 55));
        data.add(new Data('Oct', 78, 66, 56));
        data.add(new Data('Nov', 80, 67, 53));
        data.add(new Data('Dec', 17, 70, 70));
        return data;
    }
    
    // Wrapper class 
    
    public class Data {
        public String name { get; set; }
        public Integer data1 { get; set; }
        public Integer data2 { get; set; }
        public Integer data3 { get; set; }
        public Data(String name, Integer data1, Integer data2, Integer data3) {
            this.name = name;
            this.data1 = data1;
            this.data2 = data2;
            this.data3 = data3;
        }
    }
}

 

Hi everyone,

 

I would like to know if there is a way to check if a user is using a mobile device or computer when accessing a visualforce page.

I would like mobile users to see certain fields and comptuer users to see certain fields.

Ok so I have been working on a custom public site. Everything on the site is working fine until I try to open a popup window from the visuaforce page. When I do that on certain browsers Like IE i get a warning message.

 

The message reads:

 

To display the webpage again, the web browser needs to resend the information you've previously submitted. If you were making a purchase, you should click Cancel to avoid a duplicate transaction. Otherwise, click Retry to display the webpage again.

 

Is there any way to stop this warning from appearing when I have a popup window open?

I am creating an email template. I would like the email template to show the first name of a contact attached to a custom object I build. I have tried this: {!Object__c.Contact__c.FirstName} but it shows up as a blank on the email. Is it possible to show just the first name of the contact related to the custom object. Thank. 

I would like to change the color of one of my pageblocksections. Below is just a sample if what I would like to do. I would like to change the color of the first pageblocksection. I would like to know if this is possible or not. 

 

Thanks. 

<apex:page>
<apex:form>
    <apex:pageblock>
        <apex:pageBlockSection>
            <apex:pageBlockSection>
            </apex:pageBlockSection>
            <apex:pageBlockSection>
            </apex:pageBlockSection>
        </apex:pageBlockSection>
    </apex:pageblock>
</apex:form>
<apex:page>

 

I am having some issues that I need some help with.

 

I have a page with a field set on it that is part of a repeat tag. I want the look up field to auto populate with the users first and last name. I have found a way to populate the look up but it can't be part of the repeat tag. I am not sure what the problem is. 

 

Visualforce code:

 

<apex:page standardController="Account" showHeader="false">
 <script type="text/javascript" charset="utf-8" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>  
 <script type="text/javascript" charset="utf-8" src="http://code.jquery.com/mobile/1.0b3/jquery.mobile-1.0b3.min.js"></script>
  <apex:form id="AccountForm">
      <apex:pageBlock id="AccountBlock">
      <apex:pageBlockSection id="AccountSection">
          <apex:inputField id="Contact" value="{!Account.Contact_Test__c}" rendered="true"/>
          <apex:repeat id="FieldList" value="{!$ObjectType.Account.FieldSets.test}" var="set">
              <apex:inputField id="ContactLookup" value="{!Account[set]}" rendered="{!CONTAINS(LOWER(set), LOWER('Contact_Test__c'))}"/>
              <apex:inputField value="{!Account[set]}" rendered="{!NOT(CONTAINS(LOWER(set), LOWER('Contact_Test__c')))}"/>
          </apex:repeat>
      </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
<script type="text/javascript">
  try
  {
    var form = document.getElementsByTagName("FORM");
    var formid= '#' + form[0].id.replace(/:/g, "\\:");
    $(formid+"\\:AccountBlock\\:AccountSection\\:Contact").val('{!$User.FirstName} {!$User.LastName}');
  }
  catch(err)
  {
    alert(err);
  }
</script>
</apex:page>

 

I am working with a custom object that has a look up field. I was wondering if it is possible to plug in a partail name into the look up field and then search using the look up field. I know I can type the name into the look up and that works but I would like to auto fill the lookup field with a partail name. Im not sure if this is possible and would like some guidence. Thanks.

I have implemented the recaptcha in my site. However I am running into an issue. The issue is not that major and I can live with it but I would like some help fixing it. My issue is that when I come to the page with the recaptcha on it the focus of the page is the response field for the recaptcha. I would like it to be the first field on the page. I followed the help on this article:

 

http://wiki.developerforce.com/page/Adding_CAPTCHA_to_Force.com_Sites

 

Is there any way to make the focus go off of the recaptcha and onto the first field?

Is there a way to display how many characters the user has left like it does on a detail page. The issue I am running into is that when I try to save the data I put into the field the page tells me that I am over the character count. However I don't know by how much. So I am forced to guess. Thanks.