-
ChatterFeed
-
2Best Answers
-
0Likes Received
-
0Likes Given
-
8Questions
-
21Replies
Way to build queries with dynamic variables?
Hi All,
I think this is probably impossible, but wanted to see if anyone had any genius ideas....
I want to build a query using all variables. So for example, I would have an object var, a fields list var, an operator var, and a value var. So it would look something like this in my head:
List<object> myList = new List<object>([select fields list FROM object WHERE field operator value]);
Any thoughts?
-
- StephenJacobGoldberg
- February 20, 2011
- Like
- 0
- Continue reading or reply
Looking for Exp Salesforce.com Developer/Tech Lead
Hi -
I'm looking for an experienced Salesforce.com Developer to join our Salesforce.com practice. Need someone who has solid development background, native English speaker, and located in Denver, CO.
Very solid consulting company, with lots of Salesforce.com projects in our pipeline and looking for consultants to fill those positions.
Please shoot me an email if you are interested in learning more
stephen.goldberg@statera.com
443.677.5454
-
- StephenJacobGoldberg
- December 16, 2010
- Like
- 0
- Continue reading or reply
can't get param from vforce page to apex method
I have a command button, and when I try and use it in the visualforce page I am not able to reterive the paramter from the page, it returns null
Here is the visualforce code
<apex:page standardController="Account" extensions="Controller_DupeChecker"> <apex:form > <apex:dataTable value="{!DupeAccounts}" var="das" width="100%" border="1px" style="text-align:center"> <apex:column headerValue="Account Names" value="{!das.Name}"/> <apex:column headerValue="Phone" value="{!das.Phone}"/> <apex:column headerValue="Shipping Street" value="{!das.ShippingStreet}"/> <apex:column headerValue="Billing Street" value="{!das.BillingStreet}"/> <apex:column > <apex:commandButton action="{!MergeAccounts}" value="Merge" id="theButton"> <apex:param name="acid" value="{!das.id}"/> </apex:commandButton> </apex:column> <apex:column >{!das.id}</apex:column> </apex:dataTable> </apex:form> </apex:page>
And here is the apex class
public PageReference MergeAccounts(){ // aid is not passing a value Id aid = System.currentPageReference().getParameters().get('acid'); List<Account> mergeAccounts = new List<Account>(); system.debug('aid: ' + aid); Account mergeAccount = ([select Id FROM Account WHERE Id =:aid]); //merge function doesn't bring over fields merge acc mergeAccount; return null; }
Please help!
-
- StephenJacobGoldberg
- November 17, 2010
- Like
- 0
- Continue reading or reply
System.FinalException: Record is read-only: Class.CommissionHelper.updateCommission
I have a trigger which calls a method in an apex class to update an object. I am getting the error "execution of AfterUpdate caused by: System.FinalException: Record is read-only: Class.CommissionHelper.updateCommissions: line 49, column 6" and I am not sure why please help!
Apex class
public static void updateCommissions(List<Commission__c> commList){ List<Quote> quoteList = new List<Quote>(); List<Commission__c> commUpdateList = new List<Commission__c>(); Set<ID> qIds = new Set<ID>(); for(Commission__c c: commList){ qIds.add(c.Quote__c); } quoteList = [select Id, Sales_Commission__c FROM Quote where id in: qIds]; for(Commission__c c: commList){ for(Quote q: quoteList){ if(q.id == c.Quote__c){ c.Sales_Commission__c = q.Sales_Commission__c * c.Split_Percentage__c/100; commUpdateList.add(c); } } } update commUpdateList; }
Apex Trigger
trigger Commission_Before on Commission__c (after insert, after update) { Map <id, double> totalSplitMap = new Map<id, double>(); totalSplitMap = CommissionHelper.caclulateTotalSplit(Trigger.new); system.debug('totalSplitMap: ' + totalSplitMap); for(Commission__c c: Trigger.new){ system.debug('totalSplit: ' + totalSplitMap.get(c.id) ); if(totalSplitMap.get(c.id) > 100){ c.addError('The Total Commission across splits must equal 100. It is currently equal to ' + totalSplitMap.get(c.id)); } else{ CommissionHelper.updateCommissions(Trigger.new); } } }
-
- StephenJacobGoldberg
- November 08, 2010
- Like
- 0
- Continue reading or reply
VisualForce CSS won't align righ
Hi -
I am trying to get this visualforce page to align right so that it looks like it is part of the page, but no matter what I try if I use the Salesforce standard style classes, "dataCol" and "labelCol", it won't align right. I've tried using inlline style with outputText fields, I've tried div tags, I've tried everything I think of,... please help.
Here is the code
<apex:page showHeader="false" standardController="Event" extensions="Controller_eventTZPage" > <apex:variable var="newUI" value="newSkinOn" rendered="{!$User.UIThemeDisplayed = 'Theme3'}"> </apex:variable> <apex:pageBlock mode="maindetail"> <apex:pageBlockSection > <TABLE cellspacing="0" cellpadding="0" width="100%" height="100%" class="eventable" id="eventtable"> <TR> <TD class="labelCol">Time Zone:</TD><TD class="dataCol"> <A href="{!UserURL}?noredirect=1" target="_newindow" >GMT{!UserProfileTimezone} ({!TimeZoneSidKey})</A></TD> </TR> <TR> <TD class="labelCol">Local Start Time: </TD><TD class="dataCol"> {!TZStartTime}</TD> </TR> <TR> <TD class="labelCol">Local End Time: </TD><TD class="dataCol"> {!TZEndTime}</TD> </TR> </TABLE> </apex:pageBlockSection> </apex:pageBlock> </apex:p
here is how it appears
-
- StephenJacobGoldberg
- November 05, 2010
- Like
- 0
- Continue reading or reply
Looking for offshore partner
US based consulting company looking to partner with an offshore firm. Need to have deep SFDC knowledge, and spoken and written English competency. Please send me a PM with rates per hour, location, number of resources, and average years of exp per resource.
-
- StephenJacobGoldberg
- November 02, 2010
- Like
- 0
- Continue reading or reply
Visualforce Page list is returning the entire list instead of one value ...
I have a datatable and I am passing a list to the table all my other merge fields are displaying one value only but the Quantity field is displaying the whole list. I am not sure why this is happening. Thanks in advance.
Here is the relevant code from the controller class
public List<double> getQuantities(){ List<Double> quantities = new List<Double>(); for(QuoteLineItem qti :theLineItems){ if(qti.Description.contains('Cage') || qti.Description.contains('cage') || qti.Description.contains('Private') || qti.Description.contains('private')){ quantities.add(1); } else{ quantities.add(qti.Quantity); } } return quantities; }
the relevant code from the vforce page
<DIV width="100%" style="background-color: #807F84; color: #FFFFFF;">Monthly Recurring Charges </DIV> <apex:dataTable value="{!LineItems}" var="LIs" width="100%" border="1px" > <apex:column headerValue="Line Item" value="{!LIs.Description}" headerClass="tableHead"/> <apex:column headerValue="Quantity" value="{!Quantities}"/> <apex:column headerValue="Unit Price" value="{!LIs.UnitPrice}"/> <apex:column headerValue="MRC" value="{!LIs.Total_MRC__c}"/> </apex:dataTable>
-
- StephenJacobGoldberg
- October 08, 2010
- Like
- 0
- Continue reading or reply
Unknown property 'VisualforceArrayList
Hi.
I am getting the following error on a vforce page I am trying to create
Save error: Unknown property 'VisualforceArrayList.Description'
and I have no idea why. I have treid using a list, and not using a list. I have tried everything I can think of, but nothing seems to help. Any help is much appreciate so thank you in advance.
Here is the relevant parts of the controller class
public with sharing class Controller_QuotePage { public Quote qt {get; set;} public List<QuoteLineItem> theLineItems {get; set;} public Controller_QuotePage(ApexPages.StandardController controller) { Id quoteID = ((Quote) controller.getRecord()).Id; loadQuote(quoteId); loadQuoteLineItems(quoteId); } public List<QuoteLineItem> getLineItems(){ return theLineItems; } private void loadQuote(String quoteId) { this.qt = [Select Id, Site_Address__c, CreatedDate,ExpirationDate FROM Quote where Id=:quoteId]; } private void loadQuoteLineItems(String quoteId) { this.theLineItems = [SELECT Id, Description, Quantity, UnitPrice, TotalPrice,Total_MRC__c, Total_NRC__c FROM QuoteLineItem WHERE QuoteId =: quoteId]; } }
And here is the relevant parts of the visualforce page
<apex:page standardController="Quote" renderAs="pdf" extensions="Controller_QuotePage"> <apex:dataTable value="{!LineItems}" var="LineItems"> <apex:column headerValue="Line Item" value="{!LineItems.Description}"/> </apex:dataTable> </apex:page>
-
- StephenJacobGoldberg
- October 06, 2010
- Like
- 0
- Continue reading or reply
can't get param from vforce page to apex method
I have a command button, and when I try and use it in the visualforce page I am not able to reterive the paramter from the page, it returns null
Here is the visualforce code
<apex:page standardController="Account" extensions="Controller_DupeChecker"> <apex:form > <apex:dataTable value="{!DupeAccounts}" var="das" width="100%" border="1px" style="text-align:center"> <apex:column headerValue="Account Names" value="{!das.Name}"/> <apex:column headerValue="Phone" value="{!das.Phone}"/> <apex:column headerValue="Shipping Street" value="{!das.ShippingStreet}"/> <apex:column headerValue="Billing Street" value="{!das.BillingStreet}"/> <apex:column > <apex:commandButton action="{!MergeAccounts}" value="Merge" id="theButton"> <apex:param name="acid" value="{!das.id}"/> </apex:commandButton> </apex:column> <apex:column >{!das.id}</apex:column> </apex:dataTable> </apex:form> </apex:page>
And here is the apex class
public PageReference MergeAccounts(){ // aid is not passing a value Id aid = System.currentPageReference().getParameters().get('acid'); List<Account> mergeAccounts = new List<Account>(); system.debug('aid: ' + aid); Account mergeAccount = ([select Id FROM Account WHERE Id =:aid]); //merge function doesn't bring over fields merge acc mergeAccount; return null; }
Please help!
- StephenJacobGoldberg
- November 17, 2010
- Like
- 0
- Continue reading or reply
Retrieving a String list from Apex get function with Javascript in VF
Is there a way to return a JavaScript array of Strings from Apex? Or is there a datatype in Javascript I need to use for an Apex List<String>?
A simple example of what I'd like to do:
Apex function:
public List<String> getStringList(){
List<String> example = {"email@gmail.com","email@yahoo.com","email@mac.com"};
return example;
}
Javascript function in VisualForce
var stringList;
function() {
stringList = {!String};
document.writeln(stringList[0]);
}
- Gram
- November 15, 2010
- Like
- 0
- Continue reading or reply
Is there any type of paid support for development?
I have asked three questions on these forums over the past few weeks and I have not received any responses. I feel like I am wasting my time here
Is there paid support for developers? I am willing to pay.
- Gstarkey
- November 14, 2010
- Like
- 0
- Continue reading or reply
How do I add the Save & New button to my Customer Portal
I need help with adding the Save & New button to my Customer Portal. On the edit page, the only buttons I have are Submit and Cancel.
Clyde
London
- Cwlexus
- November 12, 2010
- Like
- 0
- Continue reading or reply
Not able to change style in PDF
Hi All,
I have developed a visualforce page and rendered that page as PDF. I have applied font styles and css styles.
When i render the page as PDF font styles are not applied on PDF, but if make it as simple vf page i'm able to see the font style changes. Please help me to sort out this issue.
Thank you.
- chiranjeevitg
- November 09, 2010
- Like
- 0
- Continue reading or reply
System.FinalException: Record is read-only: Class.CommissionHelper.updateCommission
I have a trigger which calls a method in an apex class to update an object. I am getting the error "execution of AfterUpdate caused by: System.FinalException: Record is read-only: Class.CommissionHelper.updateCommissions: line 49, column 6" and I am not sure why please help!
Apex class
public static void updateCommissions(List<Commission__c> commList){ List<Quote> quoteList = new List<Quote>(); List<Commission__c> commUpdateList = new List<Commission__c>(); Set<ID> qIds = new Set<ID>(); for(Commission__c c: commList){ qIds.add(c.Quote__c); } quoteList = [select Id, Sales_Commission__c FROM Quote where id in: qIds]; for(Commission__c c: commList){ for(Quote q: quoteList){ if(q.id == c.Quote__c){ c.Sales_Commission__c = q.Sales_Commission__c * c.Split_Percentage__c/100; commUpdateList.add(c); } } } update commUpdateList; }
Apex Trigger
trigger Commission_Before on Commission__c (after insert, after update) { Map <id, double> totalSplitMap = new Map<id, double>(); totalSplitMap = CommissionHelper.caclulateTotalSplit(Trigger.new); system.debug('totalSplitMap: ' + totalSplitMap); for(Commission__c c: Trigger.new){ system.debug('totalSplit: ' + totalSplitMap.get(c.id) ); if(totalSplitMap.get(c.id) > 100){ c.addError('The Total Commission across splits must equal 100. It is currently equal to ' + totalSplitMap.get(c.id)); } else{ CommissionHelper.updateCommissions(Trigger.new); } } }
- StephenJacobGoldberg
- November 08, 2010
- Like
- 0
- Continue reading or reply
Color value not displayed in VF

- forceone
- November 05, 2010
- Like
- 0
- Continue reading or reply
Apex referece between customer objects
I am fairly new to Apex and Force.com in general. I have been going through the Force.com Workbook (the one that comes with Eclipse Force IDE Help File) which has an example Adding Apex Trigger, with the following code:
trigger HandleProductPriceChange on Merchandise__c (after update) {
List<Line_Item__c> openLineItems =
[SELECT j.Unit_Price__c, j.Merchandise__r.Price__c
FROM Line_Item__c j
WHERE j.Invoice_Statement__r.Status__c = 'Negotiating'
AND j.Merchandise__r.id IN :Trigger.new
FOR UPDATE];
}
The problem: The reference j.Invoice_Statement__r.Status__c don't work. The code code-complete-assist show me j.invoice_Statement__r and I can't see Status__c attribut.
Error: "Save error: Didn't understand relationship 'Unit_Price__c' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. Force.com save problem"
Can you help me please? Thank
- horosh
- November 05, 2010
- Like
- 0
- Continue reading or reply
Trying to add summary values to a apex:pageBlockTable
I'm just learning, so please bear with me. I'm making a case-merge application. The user selects cases to be merged and presses a list button. This launches a VF page that displays the selected cases in an apex:pageBlockTable.
I would now like to add a number of summary columns to this table. The summary columns show how many emails, tasks, attachments, etc.. each of the cases to be merged has.
In my VF page I have:
<apex:column value="{!item.CaseNumber}"/>
<apex:column value="{!item.Subject}"/>
...etc...
</apex:pageBlockTable>
In my class I have:
public Case[] getSelectedCases() {
Set<Id> selectedCaseIds = new Set<Id>();
for (SObject c : setCon.getSelected()) {
selectedCaseIds.add(c.Id);
}
SObject[] items = [SELECT c.Id, c.CaseNumber, c.Subject, c.Contact.Name, c.Account.Name,
c.CreatedDate, c.Origin, c.LastModifiedDate FROM Case c WHERE Id IN :selectedCaseIds];
return items;
}
I now would like to add a number columns to my table that are the results of queries like:
SELECT count() FROM CaseComment cc WHERE cc.ParentId = EACH CASE ID IN THE ABOVE SET;
so my ultimate display shows
<apex:pageBlockTable value="{!SelectedCases}" var="item">
<apex:column value="{!item.CaseNumber}"/>
<apex:column value="{!item.Subject}"/>
<apex:column value="{!item.CountOfCaseComments}" />
...etc...
</apex:pageBlockTable>
Thanks!
- Andy123
- November 05, 2010
- Like
- 1
- Continue reading or reply
Styling an apex:pageBlockTable with a break before description column (missing border!)
Hello Everyone,
I'm having a real hard time styling an apex:pageBlockTable. I have a series of four columns containing fields from a custom object, and then another field containing a long description that I position underneath the previous fields using breakbefore="true" . I am spreading this field to the whole length of the row using colspan="4". The problem is that the lines betweens the columns and rows are behaving strangely and I can find no way of altering them. My ideal result would be for the rows to be clearly identifiable as "belonging to each other", placing borders between "pairs" of rows for example.
To illustrate the problem, I have built up a similar example using the contact object instead of my custom object.
Page Code
<apex:page controller="StylePageBlockTableController"> <apex:pageBlock > <apex:pageBlockTable value="{!allContacts}" var="contact"> <apex:column value="{!contact.Name}" headervalue="Full Name"/> <apex:column value="{!contact.Title}" headervalue="Title"/> <apex:column value="{!contact.Department}" headervalue="Department"/> <apex:column value="{!contact.Phone}" headervalue="Phone"/> <apex:column value="{!contact.Email}" breakBefore="true" colspan="4"/> </apex:pageBlockTable> </apex:pageBlock> </apex:page>
Controller Code
public class StylePageBlockTableController { public List<Contact> getAllContacts(){ return [select Name, Title, Department, Email, Phone from Contact limit 5 ]; } }
Here is a screenshot of the table, as I have highlighted, there is a random "missing border line" that always appears (or rather doesn't) at exactly half way down the table. No matter what the size of the table, this missing line is always in the middle.
I have tried using style classes and the rules attribute (which seems utterly redundant and does not seem to affect anything, perhaps the new SF styling??) amongst others. Any ideas anyone, greatly appreciated!
- Christopher_Alun_Lewis
- October 11, 2010
- Like
- 0
- Continue reading or reply
Visualforce Page list is returning the entire list instead of one value ...
I have a datatable and I am passing a list to the table all my other merge fields are displaying one value only but the Quantity field is displaying the whole list. I am not sure why this is happening. Thanks in advance.
Here is the relevant code from the controller class
public List<double> getQuantities(){ List<Double> quantities = new List<Double>(); for(QuoteLineItem qti :theLineItems){ if(qti.Description.contains('Cage') || qti.Description.contains('cage') || qti.Description.contains('Private') || qti.Description.contains('private')){ quantities.add(1); } else{ quantities.add(qti.Quantity); } } return quantities; }
the relevant code from the vforce page
<DIV width="100%" style="background-color: #807F84; color: #FFFFFF;">Monthly Recurring Charges </DIV> <apex:dataTable value="{!LineItems}" var="LIs" width="100%" border="1px" > <apex:column headerValue="Line Item" value="{!LIs.Description}" headerClass="tableHead"/> <apex:column headerValue="Quantity" value="{!Quantities}"/> <apex:column headerValue="Unit Price" value="{!LIs.UnitPrice}"/> <apex:column headerValue="MRC" value="{!LIs.Total_MRC__c}"/> </apex:dataTable>
- StephenJacobGoldberg
- October 08, 2010
- Like
- 0
- Continue reading or reply
Unknown property 'VisualforceArrayList
Hi.
I am getting the following error on a vforce page I am trying to create
Save error: Unknown property 'VisualforceArrayList.Description'
and I have no idea why. I have treid using a list, and not using a list. I have tried everything I can think of, but nothing seems to help. Any help is much appreciate so thank you in advance.
Here is the relevant parts of the controller class
public with sharing class Controller_QuotePage { public Quote qt {get; set;} public List<QuoteLineItem> theLineItems {get; set;} public Controller_QuotePage(ApexPages.StandardController controller) { Id quoteID = ((Quote) controller.getRecord()).Id; loadQuote(quoteId); loadQuoteLineItems(quoteId); } public List<QuoteLineItem> getLineItems(){ return theLineItems; } private void loadQuote(String quoteId) { this.qt = [Select Id, Site_Address__c, CreatedDate,ExpirationDate FROM Quote where Id=:quoteId]; } private void loadQuoteLineItems(String quoteId) { this.theLineItems = [SELECT Id, Description, Quantity, UnitPrice, TotalPrice,Total_MRC__c, Total_NRC__c FROM QuoteLineItem WHERE QuoteId =: quoteId]; } }
And here is the relevant parts of the visualforce page
<apex:page standardController="Quote" renderAs="pdf" extensions="Controller_QuotePage"> <apex:dataTable value="{!LineItems}" var="LineItems"> <apex:column headerValue="Line Item" value="{!LineItems.Description}"/> </apex:dataTable> </apex:page>
- StephenJacobGoldberg
- October 06, 2010
- Like
- 0
- Continue reading or reply
Denver Based Resources Needed!
- Spinnaker
- March 21, 2006
- Like
- 0
- Continue reading or reply