• bozotheclown
  • NEWBIE
  • 15 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 130
    Questions
  • 136
    Replies
Hello.  I am trying to create a commandbutton on a VF page that will open a PDF in a separate browser.  I know that I have to upload the PDF to the Documents object - but I am not sure what to do beyond that.  Any suggestions?

Thanks in advance.
Hello.  I was wondering if someone could give me some guidance.  I am pretty sure this is an order of execution issue as it relates to using an action function/dynamic component

I am having problems with how an action function acts after error messages.

The below code is a simple process we have for saving a shipment status.  We use a button tied to an action function on the page to populate the "FieldA".

SCENARIO 1
I populate the status field and press the actionfunction button...then "Save".  All works fine - as I next see the myPage.

SCENARIO 2
I manually check the status__c field...then "Save".  All works fine - as I next see the myPage.

SECENARIO 3
I forget to populate the status__c field (by clicking the button or manually)...and I press the "save" button.  I receive an error message.  I then go back to the status__c picklist field..and all works fine - as I next see the myPage.

SECENARIO 4
I forget to populate the status__c field...and I press the "save" button.  I receive an error message.  HOWEVER, this time i press the button tied to the action function...then I press the "save" button.  Strangely,  I  am then prompted with my override message.  That should not be happening.

Long story short, pressing the actionfunction button after the error message is displayed prevents the status__c field to be properly read.

Any suggestions on how I can pass the status__c value after pressing the button (after the error is displayed)?

I do know the code works...so the problem is specifically between an error message display, an action function and rerendering...my research leads me to beleive that this is an order of execution issue.

Thanks in advance.

public PageReference save() {


if(Status__c<>null)  // The field is populated by either a picklist or by a button tied to an action function - the problem happens when the button is pressed after an error message is displayed
//  
{
orderok__c = true;
NoMgtReviewNeeded = true;
}
ELSE
{
error=true;
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'No status.  Revise.'));
}

if(error<>true)
{

if(NoMgtApprovalNeeded==true)
{
insert aaa;
return myPage;
}
ELSE
{
return null;
}

ELSE
{
return null;
}

}

VF
<apex:commandButton action="{!save}" value="Save""/>
<br/>
<apex:outputText value="A 'Manager Override' is required!" rendered="{!NoMgtApprovalNeeded=false && aaa.orderok__c=true}"/>
<br/>
<br/>
<apex:commandButton action="{!Override}" value="Manager Override" rendered="{!NoMgtApprovalNeeded=false && aaa.orderok__c=true}"/>


Hello.  I was curious if anyone knew if it was even possible to develop a VF page to replace the typical user administration page.

Specifically, we have developed an app based completely on VF pages.  We want to give our admin end-users the ability to do a few limited things that are available via the Setup --> Manage Users --> Users page in the standard force.com UI (just to see a list of users and activate/deactivate them).

Is this possible?  I could not find any examples online where this has been done.

Thanks in advance.
Hello.  I am struggling to identify a way to prevent multiple records being created by clicking a commandbutton multiple times (often due to a slow internet connection).  I know there are a few ways to accomplish this if the commandbutton is not set up to take the user to another page (simply by making the button disappear briefly, etc).

However, my problem is that I have a commandbutton that inserts a record and then takes the user to another page.  It seems the tricks for making a button disappear briefly (such as actionstatus) do not work when the commandbutton is taking the user to a different page.

In other words, I am trying to figure out a way for a user to click a commandbutton...the button will disappear...and the user will then be taken to the next page.

Any suggestions?

Thanks in advance.
Hello.  I have an app with several custom controllers.  I have about 200 lines of apex code that are identical between "CustomControllerA" and "CustomControllerB".  For maintenance purpuses, I ideally would NOT like to have identical lines of code in various controllers - so is there any way that I can share this code between the two controllers?  I thought an extension might work...but my initial research is telling me no.

Thanks in advance.
I am having issues developing a test for the below code.  Any suggestions would be greatly appreciated.

Thanks in advance.



Public String GrabDate { get; set;}
Public String ComputedValSTR { get; set;}
Public Decimal ComputedVal { get; set;}

public List<aaa> getzzz() {
List<aaa> bbb = new List<aaa>();
AggregateResult[] ccc = [SELECT Date__c dt, SUM(Charges__c) FROM Cars__c GROUP BY Date__c ORDER BY Date__c asc];
for (AggregateResult xxx : ccc) {
GrabDate = string.valueOf(xxx.get('dt'));
ComputedValSTR = string.valueOf(xxx.get('expr0'));
ComputedVal = decimal.valueOf(ComputedValSTR);
bbb.add(new aaa(GrabDate, ComputedVal));
}
return bbb;
}


public class aaa {
public String DtValue { get; set; }
public Decimal ChargesVal { get; set; }

public aaa(String DtValue, Decimal ChargesVal) {
this.DtValue = DtValue;
this.ChargesVal = ChargesVal;
}
}
Hello.  I am trying to change (to VF charts) some of my charts that are currently displayed on a VF page via Google charts.

I understand the basics of how to create a chart via VF charting.  However, I am having a bit of trouble creating a line chart over a date range.  Specifically, I have 10 records spanning a six month period.  Each of these records has a corresponding dollar amount.  My goal is to create a line graph with the dollar amount as the Y axis...and the date as the X axis.  Unfortunately the date intervals are not uniform for these ten records (seven of them occur during the first three months).

So, does anyone have an examples of how line charts are created depicting date intervals (via the new VF charting capability)?  I had tried to look for some examples and could not find anything.

Thanks in advance.

Hello.  I tried to run tests on several classes today...and I am seeing a lot of error messages such as "Could not run tests on class xxxx".

 

This is odd because most of the classes I am testing have tested fine just a few days ago (and no edits have been made to the class since the most recent test).

 

Is anyone else seeing this?

 

 

Thanks

Hello.  I am having some issues identifying the correct way to save a list and ALSO save the values from a RELATED OBJECT in this list.

 

From my research, I know this can be done in force.com...but I just am not using the appropriate syntax.

 

I have a list

myList = SELECT [modelcomments__c, modelname__c, make__c,  manufacturer__r.rating__c FROM models__c];

 

I have a VF page that uses inputFields  to ask the user to update the value of modelcomments__c and manufacturer__r.rating__c fields.

 

I easily am able to save the modelcomments__c field via...

"update myList;"

 

However, to update the manufacturer object, I thought all I needed was to enter...

"update myList.manufacturer__r;"

 

Unfortunately, I was wrong.  Can anyone tell me how I can save the updated value of manufactuer__r.rating field?

 

Thanks in advance.

Hello.  Could someone help me figure out how to view my line-by-line code coverage (the red vs blue shaded lines).  Most recently, all I had to do was go to the Developer Console and double-click on the corresponding controller (in the bottom right-hand corner).  Unfortunately, this "Overall Code Coverage" box is now empty - and I can't figure out any other way to view my coverage.  Did something change with the new release?

 

 

Thanks

Quick question.  Can anyone tell me how I can modify the font SIZE of the tabs I am using in a dynamic component.  The weird thing is that I can control the font weight (as shown below in #1)...and even the width of the tab...but for some reason I cannot make the font a little larger.

 

Thanks in advance.

 

 

// #1 - This works

Component.Apex.Tab xxxTab = new Component.Apex.Tab(style='font-weight:bold;');  

 

// #2 - This does not work.  Why?

Component.Apex.Tab xxxTab = new Component.Apex.Tab(style='font-size:25px;');  

Hello.  I am using dynamic VF components for the first time and am experiencing some issues.

 

I have learned that the "apex:param" component is not covered by dynamic components...so I am trying to identify a workaround.

 

In short, I have a group of tabs - each with several commandbuttons/commandlinks inside of each tab.  I want to be able to...

1) choose a tab

2) then press a commandbutton/commandlink inside of the selected tab

3) then, my selected result would be shown in a lower panel.  

 

I know how to set up the tabs/buttons...but I am having issues figuring out how to get the name displayed in the panel below.

 

Thanks in advance.

Hello.  I am having issues getting radio buttons to appear in a series of tabs created via Dynamic Components.

 

In short, I am SUCCESSFULLY displaying a list of tabs from my Cars__c object (each tab is showing a unique occurrence of the Type__c value in the Cars__c object).  However, I then want radio button displayed for each car name in the corresponding tab.  Unfortunately, all I am seeing is the tab values - no radio button choices are being shown at all.  Can anyone give me some guidance?

 

Thanks in advance.  Below is my code - note the section marked where I am having problems.

 

 

public with sharing class myController { 

public List<Cars__c> ListA;
public myController()
{
ListA = [SELECT Type__c, name, id FROM Cars__c WHERE Type__c<>null ORDER BY Type__c asc, name asc];
}

public Component.Apex.TabPanel getCarTypeTab()
{

Component.Apex.TabPanel CarTypeTabPanel = new Component.Apex.TabPanel(title='Select type', switchType='client', tabClass='actveTab', inactiveTabClass='inactiveTab', style='padding:10px');

// Doing loop for one less than list size since we are comparing the next in line item
for (Integer bEE = 0; bEE < ListA.size()-1; bEE++)
{
// identifying during the loop when a new type appears - and creating the corresponding tab
// THIS ALL WORKS FINE
if(ListA[bEE].Type__c<>ListA[bEE+1].Type__c)
{
Component.Apex.Tab miCatMember = new Component.Apex.Tab();
miCatMember.Label = string.valueOf(ListA[bEE].Type__c);
CarTypeTabPanel.childComponents.add(miCatMember);
}

// HERE IS WHERE I AM HAVING PROBLEMS
Component.Apex.selectRadio rdBtnSetup = new Component.Apex.selectRadio();
rdBtnSetup.id = 'selectRadio';
rdBtnSetup.layout = 'pageDirection';
Component.Apex.selectOption CARoption = new Component.Apex.selectOption();
CARoption.itemValue = ListA[bEE].id;
CARoption.itemLabel = ListA[bEE].name;
CARoption.itemDisabled = false;
CarTypeTabPanel.childComponents.childComponents.add(CARoption);


}
return CarTypeTabPanel;
}
}

 

Hello. Could anyone give me some guidance with the below.

I maintain a list of sales orders and customers. I have created a VF page that lists/groups customer sales orders for a date range desired by the user. That part was easy.

My issue is that I want to show the average PER DAY sales totals for each customer in this list. Unfortunately, identifying the number of days in the date range is not easy as subtracting startdate-enddate....since I need to omit holidays/weekends.

I have tried to just identify unique occurrences of CreatedDate...but the datetime nature of this field means that multiple records from a single date are treated as multiple occurrences.

Does anyone have suggestions on how to count CreatedDate occurrences from a date perspective? Thanks in advance.


Hello. I have been showing a standard logo in all VF pages in our custom app. I done this via a static resource.

 

However, I now want to substitute this standard logo with a custom logo for each separate customer installation of our managed package (in other words, we are going to use our customer's individual logo instead of our standard logo).

 

This means that all of our VF pages needs to reference the custom logo instead of our standard one. This is where I am having problems.

 

My first idea was to just substitute the static resource image in each individual customer instance...but given that the Static Resource is part of the managed package...I cannot swap out the images.

 

Any thoughts?  Thanks in advance.

Hello.  Does anyone know what happened to the ability to click on the code coverage percentage for a speficic controller?  In the past, we could click on a percentage and see the lines of code shaded a particular color to denote coverage.  Now, when I click the coverage percentage all I get is a blank page.

 

Any thoughts?

 

 

Thanks

Hello.  I am trying to display two short radio button options in a line of text...but VF is apparently forcing a line break.

 

Specifically, ON THE SAME LINE, I am trying to list the words "Name" and "Choices" followed by two short radio buttons.  Unfortunately, the radio buttons are being placed at the beginning of line immediately below the line with "Name" and "Choices".

 

Below is my code.  Any suggestions on how to avoid the line break?  Thanks in advance,

 

<b>Name:</b>
&nbsp; &nbsp; &nbsp;
<b>Choices:</b>
<apex:selectRadio value="{!aaa}" layout="lineDirection">
<apex:selectOptions value="{!bbb}">
</apex:selectOptions>
<apex:actionSupport event="oncomplete" action="{!ccc}"/>
</apex:selectRadio>

 

Hello...I was wondering if someone could give me some guidance regarding packaging reports.

 

I just added a report in a managed package.  When I uploaded the package I noticed that the report and the custom report type was included in the package.  This made sense to me (since you need the custom report type for the report).  I then installed this new version into my test org and all worked as expected.

 

Next, I wanted to see what would happen when I made changes to BOTH the report and the custom report type.  To do this, I added fields X, Y and Z to the custom report type...and then added these same fields to the report itself.  I then uploaded the package again to my test org.  Unfortunately, the report update did not happen in my test org...although the update to the custom report type did include fields X, Y and Z.

 

So....I was curious to see if I did something wrong...or if managed custom reports cannot be modified after the first time they are added to a package?

 

Thanks in advance.

Hello. I am having an odd problem.

 

For some reason I canot log into my sandbox (although I am almost certain that I am using the correct password).  Yes, I am logging in from "test.salesforce.com"

 

I tried to use the "Forgot your password" link to get my password e-mailed to me.  Unfortunately, it has been over 12 hours and I have not yet received an e-mail (and have checked my spam folder too).

 

Any thoughts?  Has the login procedure changed for sandboxes with the latest release?

 

Thanks.

Hello.  I have an ActionPoller that forces a refresh of a VF pageBlockTable every ten seconds.  I am hoping to add an audio alert to notify if the pageBlockTable changes upon refresh.  Are we able to do this via Apex?  In other words, is there any audio alert that I could use to note that a list size has changed?

 

Thanks in advance.

Hello.  I am trying to create a commandbutton on a VF page that will open a PDF in a separate browser.  I know that I have to upload the PDF to the Documents object - but I am not sure what to do beyond that.  Any suggestions?

Thanks in advance.
Hello.  I was wondering if someone could give me some guidance.  I am pretty sure this is an order of execution issue as it relates to using an action function/dynamic component

I am having problems with how an action function acts after error messages.

The below code is a simple process we have for saving a shipment status.  We use a button tied to an action function on the page to populate the "FieldA".

SCENARIO 1
I populate the status field and press the actionfunction button...then "Save".  All works fine - as I next see the myPage.

SCENARIO 2
I manually check the status__c field...then "Save".  All works fine - as I next see the myPage.

SECENARIO 3
I forget to populate the status__c field (by clicking the button or manually)...and I press the "save" button.  I receive an error message.  I then go back to the status__c picklist field..and all works fine - as I next see the myPage.

SECENARIO 4
I forget to populate the status__c field...and I press the "save" button.  I receive an error message.  HOWEVER, this time i press the button tied to the action function...then I press the "save" button.  Strangely,  I  am then prompted with my override message.  That should not be happening.

Long story short, pressing the actionfunction button after the error message is displayed prevents the status__c field to be properly read.

Any suggestions on how I can pass the status__c value after pressing the button (after the error is displayed)?

I do know the code works...so the problem is specifically between an error message display, an action function and rerendering...my research leads me to beleive that this is an order of execution issue.

Thanks in advance.

public PageReference save() {


if(Status__c<>null)  // The field is populated by either a picklist or by a button tied to an action function - the problem happens when the button is pressed after an error message is displayed
//  
{
orderok__c = true;
NoMgtReviewNeeded = true;
}
ELSE
{
error=true;
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'No status.  Revise.'));
}

if(error<>true)
{

if(NoMgtApprovalNeeded==true)
{
insert aaa;
return myPage;
}
ELSE
{
return null;
}

ELSE
{
return null;
}

}

VF
<apex:commandButton action="{!save}" value="Save""/>
<br/>
<apex:outputText value="A 'Manager Override' is required!" rendered="{!NoMgtApprovalNeeded=false && aaa.orderok__c=true}"/>
<br/>
<br/>
<apex:commandButton action="{!Override}" value="Manager Override" rendered="{!NoMgtApprovalNeeded=false && aaa.orderok__c=true}"/>


Hello.  I have an app with several custom controllers.  I have about 200 lines of apex code that are identical between "CustomControllerA" and "CustomControllerB".  For maintenance purpuses, I ideally would NOT like to have identical lines of code in various controllers - so is there any way that I can share this code between the two controllers?  I thought an extension might work...but my initial research is telling me no.

Thanks in advance.
Hello.  I am struggling to identify a way to prevent multiple records being created by clicking a commandbutton multiple times (often due to a slow internet connection).  I know there are a few ways to accomplish this if the commandbutton is not set up to take the user to another page (simply by making the button disappear briefly, etc).

However, my problem is that I have a commandbutton that inserts a record and then takes the user to another page.  It seems the tricks for making a button disappear briefly (such as actionstatus) do not work when the commandbutton is taking the user to a different page.

In other words, I am trying to figure out a way for a user to click a commandbutton...the button will disappear...and the user will then be taken to the next page.

Any suggestions?

Thanks in advance.
I am having issues developing a test for the below code.  Any suggestions would be greatly appreciated.

Thanks in advance.



Public String GrabDate { get; set;}
Public String ComputedValSTR { get; set;}
Public Decimal ComputedVal { get; set;}

public List<aaa> getzzz() {
List<aaa> bbb = new List<aaa>();
AggregateResult[] ccc = [SELECT Date__c dt, SUM(Charges__c) FROM Cars__c GROUP BY Date__c ORDER BY Date__c asc];
for (AggregateResult xxx : ccc) {
GrabDate = string.valueOf(xxx.get('dt'));
ComputedValSTR = string.valueOf(xxx.get('expr0'));
ComputedVal = decimal.valueOf(ComputedValSTR);
bbb.add(new aaa(GrabDate, ComputedVal));
}
return bbb;
}


public class aaa {
public String DtValue { get; set; }
public Decimal ChargesVal { get; set; }

public aaa(String DtValue, Decimal ChargesVal) {
this.DtValue = DtValue;
this.ChargesVal = ChargesVal;
}
}

Hello.  Could someone help me figure out how to view my line-by-line code coverage (the red vs blue shaded lines).  Most recently, all I had to do was go to the Developer Console and double-click on the corresponding controller (in the bottom right-hand corner).  Unfortunately, this "Overall Code Coverage" box is now empty - and I can't figure out any other way to view my coverage.  Did something change with the new release?

 

 

Thanks

Hello. Could anyone give me some guidance with the below.

I maintain a list of sales orders and customers. I have created a VF page that lists/groups customer sales orders for a date range desired by the user. That part was easy.

My issue is that I want to show the average PER DAY sales totals for each customer in this list. Unfortunately, identifying the number of days in the date range is not easy as subtracting startdate-enddate....since I need to omit holidays/weekends.

I have tried to just identify unique occurrences of CreatedDate...but the datetime nature of this field means that multiple records from a single date are treated as multiple occurrences.

Does anyone have suggestions on how to count CreatedDate occurrences from a date perspective? Thanks in advance.


Hello.  Does anyone know what happened to the ability to click on the code coverage percentage for a speficic controller?  In the past, we could click on a percentage and see the lines of code shaded a particular color to denote coverage.  Now, when I click the coverage percentage all I get is a blank page.

 

Any thoughts?

 

 

Thanks

Hello. I am having an odd problem.

 

For some reason I canot log into my sandbox (although I am almost certain that I am using the correct password).  Yes, I am logging in from "test.salesforce.com"

 

I tried to use the "Forgot your password" link to get my password e-mailed to me.  Unfortunately, it has been over 12 hours and I have not yet received an e-mail (and have checked my spam folder too).

 

Any thoughts?  Has the login procedure changed for sandboxes with the latest release?

 

Thanks.

Hello.  I have an ActionPoller that forces a refresh of a VF pageBlockTable every ten seconds.  I am hoping to add an audio alert to notify if the pageBlockTable changes upon refresh.  Are we able to do this via Apex?  In other words, is there any audio alert that I could use to note that a list size has changed?

 

Thanks in advance.

Hello.  I have a quick question.

 

I have three buttons which utilize a few exact lines of code.  For this example, let's say two lines of code (although in reality, it is much more).

 

Is there a way in Apex for me to only list those lines of code once...and for each pagereference to go to those shared lines somewhere?

 

The reason for asking this is that I likely will revise the shared code...and ideally would like to only have to edit it once.

 

Thanks in advance.

 

public PageReference button1() {
// unique code here for button1
// insert identical code lines 1 and 2
return Page.AAA;
}


public PageReference button2() {
// unique code here for button2
// insert identical code lines 1 and 2
return Page.BBB;
}


public PageReference button3() {
// unique code here for button3
// insert identical code lines 1 and 2
return Page.CCC;
}



// identical code used across the three buttons - I ideally would only like to type these three lines
// just one time since I might edit it at a later date (so it would be simpler to only edit the code once)
IntegerA = IntegerB+IntegerC;  // Identical code line #1
IntegerZ = IntegerA+IntegerD;  // Identical code line #2

 

Hello.  I am trying to delete a few lines of a custom controller - via the salesforce.com section SETUP --> DEVELOP --> APEX CLASSES.  I have confirmed that I have deleted all references to these deleted lines in the rest of my controller and associated VF pages.  Unfortunately, I continue to receive the error message "This apex class is referenced elsewhere in salesforce.com. Remove the usage and try again. at line 0 column 0".  

 

I absolutely know that the deleted apex class is not referenced anywhere else in my delopymnet (VF pages, triggers, etc, etc)....so I am totally lost as to why this is happening.

 

After doing some searching on the web, I noticed a comment that you cannot delete classes...unless you do it with the migration tool.  

 

Is that my problem?  So there is no way to simply delete the line of code that references an apex class?

 

Thanks in advance.

Hello.  I have an e-mail template that is used by a workflow e-mail alert.  The e-mail alert is based on the workorder__c field.  I also have a related object (via lookup relationship) called parts__c. 

 

I am able to display the workorder__c.workordername__c field values in e-mails created from this template.  However, I am getting blanks where I am trying to display parts__r.partname__c.

 

In short, is there any way to display data from related objects in an HTML template...or can you only display data from a specific object?

 

Hope this makes sense.  Thanks in advance.

Hello. I have run into a strange issue which I was curious if anyone had seen previously. Simply put, my force.com branded login page (xxxxxx.cloudforce.com) does not save the user name even though I have been (constantly) checking the "Remember User Name" checkbox. My first thought would be that this is a browser issue...but when I go to the regular force.com login page (https://login.salesforce.com/) from the SAME browser to login to the SAME account, the "Remember User Name" checkbox works properly. Any thoughts on why this is happening? Does anyone know how to fix this? Thanks in advance.

Hello.  I am trying to customize my force.com home page with a VF page.  I have figured out to do it via Setup --> Customize --> Home  - but I still have an issue.

 

The issue is that this approach is not removing the recycle bin and the salesforce.com copyright in the footer of the page.  Does anyone know if it is possible to remove both of these items too?

 

Thanks in advance.

 

Hello Board,

 

I have been using https://login.salesforce.com/ to login into the salesforce instance.

 

Is there any way to customize this login url for example: mycompany.myproduct.com?

 

Thanks,
Devendra S

Hello. 

 

I had been seeing strange behavior on a page - and narrowed down the cause of thisodd behavior to the use of an ActionPoller.  After doing some research, it seems that using an ActionPoller with a dataTable causes problems.

 

Below is my code.  Does anyone have any suggestions how to refresh this table - but avoid known problems with ActionPoller & DataTable?

 

Any thoughts would be appreciated.  Thanks in advance.

 

<apex:pageBlock title="Customer Overview"> 
<apex:dataTable value="{!Customers}" var="cust" id="CustList" width="100%" > 
 <apex:column > 
  <apex:facet name="header"><b>Customer Name</b></apex:facet> 
  <apex:commandLink action="{!invokeService}"
                    value="{!cust.CustName__c}" rerender="blockA, blockB">
    <apex:param name="xxx" value="{!cust.id}"/>
  </apex:commandLink>
 </apex:column> 
</apex:dataTable> 
<apex:actionPoller rerender="CustList" interval="5"/>
</apex:pageBlock>