-
ChatterFeed
-
1Best Answers
-
0Likes Received
-
0Likes Given
-
12Questions
-
19Replies
Safari 5
Just installed Safari 5 and now find that the text in the built in visualpage editor is unreadable :(
( This is actually with Safari 5 under Windows XP - will try later on my Mac at home, but assume it will be the same. Safari 4 worked fine )
-
- Steve_Finlay
- June 08, 2010
- Like
- 0
- Continue reading or reply
Already created object fields have null for new required fields
-
- amorgan
- October 20, 2010
- Like
- 0
- Continue reading or reply
Populate Contact in Opportunity when New Opportunity button is pressed under Contact
-
- amorgan
- July 28, 2010
- Like
- 0
- Continue reading or reply
How do I put a <meta> tag inside <head>?
-
- amorgan
- May 02, 2010
- Like
- 0
- Continue reading or reply
Are your reports missing dates too?
This causes a problem because when you graph this report it will never show any flat spots. The graph seems at first glance to show continuos sales until it is realized that the graph is skipping months in the date axis that have no data.
I've seen this happen a few times already and I don't see how to resolve this issue. Is this a fundamental problem is Salesforce reporting?
Am I, and others, missing something?
P.S. Please don't answer "You simply need to sell more" ;-)
-
- amorgan
- January 26, 2010
- Like
- 0
- Continue reading or reply
Can I get SOQL from views?
-
- amorgan
- October 27, 2009
- Like
- 0
- Continue reading or reply
How can I check if my page is in a managed package?
If I use sforce.connection.query(soql) the query string will be different depending if the page is managed or not.
Example, if I'm in a managed packaged the query string would be
soql = "select myNamespace__myCustomField__c from myNamespace__myCustobObj__c"
but, when I deploy to another server my code becomes unmanaged and the query string needs to be:
soql = "select myCustomField__c from myCustobObj__c"
So, what's a good way to know if the code is managed or not so I can use the correct query string?
-
- amorgan
- July 16, 2009
- Like
- 0
- Continue reading or reply
Fiscal Year starts January, based on ending month
It seems that the option to base the fiscal year on "the ending month" or "the starting month" makes no sense if the starting month is January.
Is this true?
-
- amorgan
- April 17, 2009
- Like
- 0
- Continue reading or reply
How do you use listId in EnhancedList?
Ultimately I'm trying to display a list of opportunities in a paging and sortable way. apex:EnhancedList seemed perfect for what I need, but I can seem to feed it my opportunity list.
Page sample:
<apex:enhancedList listId="MyOppList" height="300"/>
Controller sample:
public Opportunity[] getMyOppList() {
return [select id, name from Opportunity];
}
How do you use listId? All the docs say is "The Salesforce object for which views are displayed"
-
- amorgan
- February 12, 2009
- Like
- 0
- Continue reading or reply
styleClass doesn't work with outputField
My Page:
<apex:page controller="TestPageCon">
<apex:outputField styleClass='XXX' value='{!field.amount}'/>
</apex:page>
My Controller:
public class TestPageCon {
public Opportunity getField() {
return [select id, amount from Opportunity limit 1];
}
}
Actual HTML output:
<span id="j_id0:j_id1">$60,000.00</span>
Where did my XXX go?
-
- amorgan
- February 04, 2009
- Like
- 0
- Continue reading or reply
Properties don't work in Pages
I have this Controller:
public class TestPageCon { public class Row { public Integer closed { get{ return 54; } } } public Row[] getRows() { Row[] rows = new Row[5]; for (Integer i=0; i < 5; i++) { rows[i] = new Row(); } return rows; } }
I have this Page:
<apex:page controller="TestPageCon">
<apex:repeat var="row" value="{!rows}">
%{!row.closed}%<br/>
</apex:repeat>
</apex:page>
I expect this:
%54%
%54%
%54%
%54%
%54%
I get this instead:
%54%
%%
%%
%%
%%
-
- amorgan
- February 02, 2009
- Like
- 0
- Continue reading or reply
bug: accessing innerclass properties more that once don't work
Expected Page Result:
54 - 54
Actual Page Result:
54 -
Notes:
Accessing the property twice in the testmethod works so this makes me think it's a VisualForce issue.
Page:
<apex:page controller="TestPageCon">
{!b.b} - {!b.b}
</apex:page>
Controller:
public class TestPageCon {
public class TestPageCon {
public class B {
public Integer b {
get {return 54;}
}
}
public B getB() {return new B();}
testmethod static void testBug() {
TestPageCon test = new TestPageCon();
System.assertEquals(test.getB().b, 54);
System.assertEquals(test.getB().b, 54);
}
}
-
- amorgan
- December 10, 2008
- Like
- 0
- Continue reading or reply
How do I display Opportunities by User?
I want to display something like this:
- User 1:
- Opportunity 1
- Opportunity 2
- User 2:
- Opportunity 3
- Opportunity 4
Here is the Page code I'm trying to use:
<apex:page controller="myController">
<apex:pageBlock title="Opportunities by User">
<apex:dataList value="{!users}" var="user">
<apex:pageBlockSection title="{!user.firstname}">
<apex:dataTable value="{!XXX what do I put here? XXX}" var="opp">
<apex:column >{!opp.name}</apex:column>
</apex:dataTable>
</apex:pageBlockSection>
</apex:dataList>
</apex:pageBlock>
</apex:page>
Here is the Controller Code:
public class myController {
public List getUsers() {
return [select firstname from user];
}
public List getOppsForUser(User user) { // How can I use this method?
return [select name from opportunity where ownerid=:user.id];
}
}
-
- amorgan
- November 22, 2008
- Like
- 0
- Continue reading or reply
Populate Contact in Opportunity when New Opportunity button is pressed under Contact
- amorgan
- July 28, 2010
- Like
- 0
- Continue reading or reply
Safari 5
Just installed Safari 5 and now find that the text in the built in visualpage editor is unreadable :(
( This is actually with Safari 5 under Windows XP - will try later on my Mac at home, but assume it will be the same. Safari 4 worked fine )
- Steve_Finlay
- June 08, 2010
- Like
- 0
- Continue reading or reply
Updating OpportunityLineItem from Product2
Can someone tell me what I'm missing here. In the debug log it says no records found after I update an OpportunityLineItem record:
Trigger.oppLineItem_prod_data_trigger2: line 20, column 33: SOQL query with 0 rows finished in 3 ms
trigger oppLineItem_prod_data_trigger2 on OpportunityLineItem (after insert, after update) { Set<String> opportunityLineItemIDs = new Set<String>(); List<OpportunityLineItem> updtOpportunityLineItems = new List<OpportunityLineItem>(); OpportunityLineItem[] opportunityLineItems = new List<OpportunityLineItem>(); OpportunityLineItem[] oliList = [select pricebookentry.product2.bu_code__c FROM OpportunityLineItem where id in :opportunityLineItemIDs]; for(OpportunityLineItem oli : oliList) { oli.bu_code__c = oli.pricebookentry.product2.bu_name__c; } update oliList; }
- Colealars
- November 10, 2009
- Like
- 0
- Continue reading or reply
How TO add a new UserRole Record in test class
I need to create a UserRole record as part of test class. The field 'PortalType' is a picklist defined field. I've seen several examples of reading the values from the picklist but no examples of how to create a new record containing a picklist field. not a new value, but a existing value within the picklist for this note new UserRole record. For example, this snippet will result in the error :'Field PortalType is not writable'. What is the correct procedure?
Regards,
UserRole r = new UserRole(RollupDescription =a.Name + ' Customer Manager',PortalType = 'Customer Portal', PortalRole = 'Manager', PortalAccountId = a.Id); insert r;
- Vegaln1
- September 29, 2009
- Like
- 0
- Continue reading or reply
How can I check if my page is in a managed package?
If I use sforce.connection.query(soql) the query string will be different depending if the page is managed or not.
Example, if I'm in a managed packaged the query string would be
soql = "select myNamespace__myCustomField__c from myNamespace__myCustobObj__c"
but, when I deploy to another server my code becomes unmanaged and the query string needs to be:
soql = "select myCustomField__c from myCustobObj__c"
So, what's a good way to know if the code is managed or not so I can use the correct query string?
- amorgan
- July 16, 2009
- Like
- 0
- Continue reading or reply
API access and Javascript.
Gurus,
need a big help. Got to deploy the code tomorrow morning and it does not work.
I wrote a javascript to create a custom button called Submit Proposal on Opportunity page. It is an onclick Javascipt.
The code is working fine on Developer edition but when I deploy it as a package in Professional edition, it is throwing me an error saying " API access" is disabled. I tried uploading the code as a package on appexchage to bypass the API thingy, still it does not work.
Here is the code, if you happen to have any suggestion for struggling me..
OnClick JavaScript | {!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")} var oppid="{!Opportunity.Id}"; var sql1 = "Select Submitted_as_Proposal__c from Opportunity Where Id = '" + oppid + "'" ; var result = sforce.connection.query(sql1); var records= result.getArray("records"); var ans=records[0].Submitted_as_Proposal__c; var opps = new Array(); opps[0] = new sforce.SObject("Opportunity"); opps[0].id = "{!Opportunity.Id}"; opps[0].Submitted_as_Proposal__c = 'Y' ; if(ans=='N') { var prop = new sforce.SObject("Proposal__c"); var rfq=new Date("{!Opportunity.RFQ_Date__c}"); rfq.setDate(rfq.getDate()); var rfp=new Date("{!Opportunity.RFP_Date__c}"); rfp.setDate(rfp.getDate()); var rfi=new Date("{!Opportunity.RFI_Date__c}"); rfi.setDate(rfi.getDate()); var adt=new Date("{!Opportunity.Estimated_Award_Date__c}"); adt.setDate(adt.getDate()); var pdt=new Date("{!Opportunity.Estimated_Proposal_Due_Date__c}"); pdt.setDate(pdt.getDate()); prop.name = "{!Opportunity.Name}"; prop.CRGT_Role__c="{!Opportunity.CRGT_Role__c}"; prop.Prime_Name__c="{!Opportunity.Prime_Name__c}"; prop.Sub_Name__c="{!Opportunity.Sub_Name__c}"; prop.Total_Contract_Vlaue__c="{!Opportunity.Total_Contract_Value__c}"; prop.CRGT_Value__c="{!Opportunity.CRGT_Value__c}"; prop.Lead_Source__c="{!Opportunity.Lead_Source__c}"; prop.OwnerId="{!Opportunity.OwnerId}"; prop.Account__c="{!Opportunity.AccountId}"; prop.Contract_Vehicle__c="{!Opportunity.Contract_Vehicle__c}"; if(rfq!='NaN') { prop.RFQ_Date__c=rfq; } if(rfi!='NaN') { prop.RFI_Estimated_Date__c=rfi; } if(rfp!='NaN') { prop.RFP_Date__c=rfp; } if(adt!='NaN') { prop.Estimated_Award_Date__c=adt; } if(pdt!='NaN') { prop.Estimated_Proposal_Due_Date__c=pdt; } if(rfp!='NaN') { prop.RFP_Date__c=rfp; } sforce.connection.create([prop]); sforce.connection.update(opps); alert("This Opportunity is now submitted as a proposal"); } else { alert("This Opportunity has already been submitted as a proposal"); } |
- Avani
- June 30, 2009
- Like
- 0
- Continue reading or reply
How do you use listId in EnhancedList?
Ultimately I'm trying to display a list of opportunities in a paging and sortable way. apex:EnhancedList seemed perfect for what I need, but I can seem to feed it my opportunity list.
Page sample:
<apex:enhancedList listId="MyOppList" height="300"/>
Controller sample:
public Opportunity[] getMyOppList() {
return [select id, name from Opportunity];
}
How do you use listId? All the docs say is "The Salesforce object for which views are displayed"
- amorgan
- February 12, 2009
- Like
- 0
- Continue reading or reply
Custom Clone Opportunity
As discussed in Ideas (http://ideas.salesforce.com/article/show/69729) here's a solution we have used for clients to enable customisation of the Clone button on Opportunities. This can be used to selectively choose which fields to copy and set default values:
For full details and the code to clone opportunity Line Items please contact me directly. We will be re-writing this in VisualForce over the coming months to make it futureproof.
Steps to Implement - Admins only
1. Setup -> Customize -> Opportunity -> Buttons and Links
2. Create new custom button called Clone, behaviour is Execute Javascript, Display Type Detail Page Button.
3. Paste in the code below and edit to match your requirements.
4. Remember to add the new button to the Opportunity page layout(s) and hide the original Clone button.
4. Test!
// Copyright 2008 BrightGen Ltd - All Rights Reserved try{ {!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")} // ** EDIT THIS QUERY TO LIST THE FIELDS YOU WANT TO COPY ** var result = sforce.connection.query("Select o.Type, o.StageName, o.Product_Type__c, o.Planned_Opportunity__c, o.MarketSector__c, o.CampaignId, o.Business_Unit__c, o.Amount, o.AccountId From Opportunity o WHERE o.Id = '{!Opportunity.Id}'"); var newOpp = result.getArray("records"); // Reset the Opp Id and reset fields to default values newOpp[0].Id = ''; newOpp[0].Name = "Clone {!Opportunity.Name}"; // ** EDIT THESE FIELDS TO SET DEFAULT ANY VALUES ** newOpp[0].StageName = "1. Prospecting"; newOpp[0].CloseDate = new Date(2099, 0, 1); var saveResult = sforce.connection.create(newOpp); if (saveResult[0].getBoolean("success")) { newOpp[0].id = saveResult[0].id; alert("Opportunity cloned without line items"); } else { alert("Failed to create clone: " + saveResult[0]); } // Refresh the page to display the new oppportunity window.location = newOpp[0].id; } catch (err) { alert (err.description ); }
- bg_richard
- February 05, 2009
- Like
- 0
- Continue reading or reply
styleClass doesn't work with outputField
My Page:
<apex:page controller="TestPageCon">
<apex:outputField styleClass='XXX' value='{!field.amount}'/>
</apex:page>
My Controller:
public class TestPageCon {
public Opportunity getField() {
return [select id, amount from Opportunity limit 1];
}
}
Actual HTML output:
<span id="j_id0:j_id1">$60,000.00</span>
Where did my XXX go?
- amorgan
- February 04, 2009
- Like
- 0
- Continue reading or reply
Package Install Failed
I can't install our package into our test org. Does anyone know how to handle this? I'd like to be able to fix it without wrangling too much with Support...
I have tried installing the package several
times yesterday and today - and I have tried to isolate the problem within the objects. I know what object is causing the problem, but not what to do. The object has installed with no problem as a different version. (From the discussion boards, it looks like there is a known issue with installing apps in an org where they were installed (and removed) before - but no one says how to fix it in the org without Support.)
The error message I get is: "Your requested install failed. Please
try this again. None of the data or setup information in your
Salesforce organization should have been affected by this error. If
this error persists, contact Support through your normal channels and
reference number: 1525493615-16962 (717204977)"
I filed a customer support case: #02400539.
- gdeseve
- January 29, 2009
- Like
- 0
- Continue reading or reply
How do I display Opportunities by User?
I want to display something like this:
- User 1:
- Opportunity 1
- Opportunity 2
- User 2:
- Opportunity 3
- Opportunity 4
Here is the Page code I'm trying to use:
<apex:page controller="myController">
<apex:pageBlock title="Opportunities by User">
<apex:dataList value="{!users}" var="user">
<apex:pageBlockSection title="{!user.firstname}">
<apex:dataTable value="{!XXX what do I put here? XXX}" var="opp">
<apex:column >{!opp.name}</apex:column>
</apex:dataTable>
</apex:pageBlockSection>
</apex:dataList>
</apex:pageBlock>
</apex:page>
Here is the Controller Code:
public class myController {
public List getUsers() {
return [select firstname from user];
}
public List getOppsForUser(User user) { // How can I use this method?
return [select name from opportunity where ownerid=:user.id];
}
}
- amorgan
- November 22, 2008
- Like
- 0
- Continue reading or reply
conversion of currency in decimal format
- Bhawna
- November 12, 2008
- Like
- 0
- Continue reading or reply
How do I get information about Fiscal Year setting through Ajax toolkit?
- BAGEL
- April 10, 2006
- Like
- 0
- Continue reading or reply