-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
0Likes Given
-
10Questions
-
18Replies
Bug with <apex:outputText> tag in Visualforce
The following Visualforce Page will fail to compile with the error message "Error: String index out of range: -40".
<apex:page standardController="Account"> <apex:outputText value="Created Date: {0,Date,MMMMM dd, yyyy}, Modified Date: {1,Date,MMMMM dd, yyyy}, Created Date 2: {0,Date,MMMMM dd, yyyy}"> <apex:param value="{!account.CreatedDate}" /> <apex:param value="{!account.LastModifiedDate}" /> </apex:outputText> </apex:page>
The following two variations, however, will compile just fine:
Variation 1:
<apex:page standardController="Account"> <apex:outputText value="Created Date: {0,Date,MMMMM dd, yyyy}, Created Date 2: {0,Date,MMMMM dd, yyyy}, Modified Date: {1,Date,MMMMM dd, yyyy}"> <apex:param value="{!account.CreatedDate}" /> <apex:param value="{!account.LastModifiedDate}" /> </apex:outputText> </apex:page>
Variation 2:
<apex:page standardController="Account"> <apex:outputText value="Created Date: {0,Date,MMMMM dd, yyyy}, Modified Date: {1,Date,MMMMM dd, yyyy}, Created Date 2: {2,Date,MMMMM dd, yyyy}"> <apex:param value="{!account.CreatedDate}"/> <apex:param value="{!account.LastModifiedDate}"/> <apex:param value="{!account.CreatedDate}"/> </apex:outputText> </apex:page>
To my mind all three variations appear to be of valid syntax - and this is a bug with the implementation of pattern matching in the Visualforce <apex:outputText> tag implementation.
Note that while the above demonstrations are relatively abstract and may appear innocuous, when I encountered this bug "in the wild" on the email template I was working on it ended up taking two hours to isolate the problem due to the vagueness of the error message. Compiler bugs (and I've encountered several working with Visualforce) should not be treated lightly.
-
- glorge
- June 19, 2010
- Like
- 0
- Continue reading or reply
BUG: Force.com Migration Tool - "Cannot rename standard profile"
I'm trying to move a custom field from one sandbox into another using the Force.com Migration Tool, and getting a funky "Cannot rename standard profile" error.
Here's my package file which goes in the "$PROJECT_ROOT/unpackaged" folder:
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>*</members> <name>Profile</name> </types> <types> <members>Account.Test__c</members> <name>CustomField</name> </types> <version>18.0</version> </Package>
Here's my ant build.xml file which sits in the $PROJECT_ROOT folder:
<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="." xmlns:sf="antlib:com.salesforce"> <property file="build.properties"/> <property environment="env"/> <target name="retrieveUnpackaged"> <mkdir dir="retrieveUnpackaged"/> <sf:retrieve username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" retrieveTarget="retrieveUnpackaged" unpackaged="unpackaged/package.xml"/> </target> <target name="deployUnpackaged"> <sf:deploy username="${sf.deploy.username}" password="${sf.deploy.password}" serverurl="${sf.deploy.serverurl}" deployRoot="retrieveUnpackaged"/> </target> </project>
This properties file all goes in the $PROJECT_ROOT folder:
# build.properties # sf.username = <username>@<org>.sandbox1 sf.password = <password> sf.serverurl = https://test.salesforce.com sf.deploy.username = <username>@<org>.sandbox2 sf.deploy.password = <password> sf.deploy.serverurl= https://test.salesforce.com
To run, execute the following two commands:
ant retrieveUnpackaged ant deployUnpackged
When I try to deploy to the second sandbox I am getting the following error:
Error: profiles/Guest License User.profile(Guest License User):Cannot rename standard profile
My package is pretty straightforward and I can't imagine what I might be doing to get this error. Any thoughts?
Thanks,
Greg
-
- glorge
- May 13, 2010
- Like
- 0
- Continue reading or reply
BUG: Error referencing SelectOption object in Visualforce Function
I am getting an error when trying to reference a SelectObject component inside of a Visualforce function. The following code sample, which attempts to set the default value in a dropdown based on an input parameter, demonstrates the issue.
Visualforce Page:
<apex:page controller="Bug">
<form action="{!$Page.bug}">
<select name="selected">
<apex:repeat value="{!selectOptions}" var="o">
<option value="{!o.value}" {!IF(o.value = selected, 'selected', '')}>
{!o.label}
</option>
</apex:repeat>
</select>
<input type="submit" value="Go!"/>
</form></apex:page>
Controller Class:
public class Bug {
public List<SelectOption> selectOptions {get; set;}
public String selected {get; set;}
public Bug()
{
selectOptions = new List<SelectOption>();
selectOptions.add(new SelectOption('S1', 'Select One'));
selectOptions.add(new SelectOption('S2', 'Select Two'));
selectOptions.add(new SelectOption('S3', 'Select Three'));
selected = ApexPages.currentPage().getParameters().get('selected');
}
}
I get the following error when I try to compile the Visualforce page:
Save error: Incorrect parameter for function =(). Expected Object, received Text
For whatever reason, the compiler seems to be think SelectObject.getValue() returns an Object rather than a String.
Interestingly enough, when I swap out the controller with the following functionally identical controller, the Visualforce page compiles without issue:
public class Bug {
public List<CustomSelectOption> selectOptions {get; set;}
public String selected {get; set;}
public class CustomSelectOption
{
public String value {get; set;}
public String label {get; set;}
public CustomSelectOption(String value, String label)
{
this.value = value;
this.label = label;
}
}
public Bug()
{
selectOptions = new List<CustomSelectOption>();
selectOptions.add(new CustomSelectOption('S1', 'Select One'));
selectOptions.add(new CustomSelectOption('S2', 'Select Two'));
selectOptions.add(new CustomSelectOption('S3', 'Select Three'));
selected = ApexPages.currentPage().getParameters().get('selected');
}
}
Any ideas here? Obviously there is a simple workaround here - but it seems to me that the original code should have compiled just fine.
Thanks,
Greg
-
- glorge
- March 08, 2010
- Like
- 0
- Continue reading or reply
How to deploy Documents with Force.com IDE
Hello,
I'm currently attempting to create/deploy a new Home Page Component (and eventually a new Home Page Layout) via the Force.com IDE. This home page will simply consist of a custom splash image that we will present to users logging into our Customer Portal.
The steps I'm trying to perform are:
1) Create a new Document (image file) via the Force.com IDE
2) Reference that image file in a new Home Page Component
3) Reference that Home Page Component in a new Home Page Layout
However, I am stuck on step 1. I can't figure out how to upload a new Document with the Force.com IDE.
I did find this thread from 2008 which says "Documents are a bit esoteric in the Metadata API. We will post a How To on developer.force.com early next week, plus we've got some exciting ideas planned for our next major release which will simplify this. Stay tuned." However, I was unable to find any How-Tos on the subject.
Is it possible to upload a Document via the Force.com IDE?
If not - would it be possible to reference a Static Resource from a Home Page Component instead? Or perhaps someone could recommend a better solution for automated deployment of Home Pages?
Thanks,
Greg
-
- glorge
- January 12, 2010
- Like
- 1
- Continue reading or reply
Apex Documentation on Custom Iterators make my brain hurt
Looking at the Apex documentation for Custom Iterators:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_iterable.htm#kanchor338
Code samples could use a bit of work:
IterableString x = new IterableString('This is a really cool test.');
while(x.hasNext()){system.debug(x.next());
}
(Note that there is no implementation provided for IterableString class)
global class CustomIterable implements Iterator<Account>{
List<Account> accs {get; set;}
Integer i {get; set;}
public CustomIterable(){
accs = [SELECT id, name, numberofEmployees FROM Account WHERE name = 'false'];
i = 0;
}
global boolean hasNext(){
if(i >= accs.size())
return false;
else
return true;
}
global Account next(){
if(i == 8){ i++; return null;}
i=i+1;
return accs[i-1];
}
}
global class foo implements iterable<Account>{
global Iterator<Account> Iterator(){
return new CustomIterable();
}
}
global class batchClass implements Database.batchable<Account>{
global Iterable<Account> start(Database.batchableContext info){
return new foo();
}
global void execute(Database.batchableContext info, List<Account> scope){
List<Account> accsToUpdate = new List<Account>();
for(Account a : scope){
a.name = 'true';
a.numberOfEmployees = 69;
accsToUpdate.add(a);
}
update accsToUpdate;
}
global void finish(Database.batchableContext info){
}
}
Code samples are a bit sloppy (i.e. "if(i == 8){ i++; return null}") and don't really demonstrate anything useful.
Edit 12/17/2009: Revised some of my earlier comments - which were a bit nitpicky and not entirely correct.
-
- glorge
- December 17, 2009
- Like
- 0
- Continue reading or reply
Force.com IDE: How do you deal with username differences between sandboxes?
Hi All,
I'm trying to use the Force.com IDE to deploy an Email Alert from one sandbox ("stage") to another sandbox ("test"). This email alert references a specific user in our system: "jondoe@gmail.com".
However - in our stage sandbox, this user's name is represented at "jondoe@gmail.com.stage", and in our test sandbox he is "jondoe@gmail.com.test". Therefore, when I try to deploy this email alert from stage to test, I get an error saying that "User jondoe@gmail.com.stage".
Has anyone figured out an effective way to deal with this issue using the Force.com IDE?
Thanks,
Greg
-
- glorge
- December 14, 2009
- Like
- 0
- Continue reading or reply
Force.com IDE : Cannot deploy individual Custom Field on a Custom Object
Hi All,
I just logged this issue with SF.com support. However, I figured I'd post the issue to the forum as well, to see which venue yields a better response. :)
---
I have a single Custom Field ("Handles_Title__c" ) on a Custom Object ("Purchase__c" ) that I would like to deploy via the Force.com IDE. However, I am getting an error "Must specify a non-empty label for the CustomObject" when I try to deploy this field.
Steps for Reproduction:
Preconditions:
I have two sandboxes, "greg" and "stage". Both sandboxes have acustom object called "Purchase__c". However, the Purchase__c object onthe "greg" sandbox has an additional field called "Handles_Title__c"that does not exist in "stage".
Steps:
1) In eclipse, go to File -> New -> Force.com Project. Create a new project pointing to the "greg" sandbox.
2) On the "Choose Initial Project Components" page, choose the"Selected metadata components" radio button, and click the "Choose..."button.
3) On the "Choose Metadata Components" page:
3.a) Expand the "objects - custom list"
3.b) Expand the "Purchase__c" list
3.c) Expand the "customfield" list
3.d) Check the box next to "Handles_Title__c"
3.e) Click the "Ok" button
4) Back on the "Choose Initial Project Contents" page, click the "Finish" button.
5) Right click the "src" folder in the newly created project. Select Force.com -> Deploy to server...
6) Enter login credentials for the "stage" sandbox, click "Next".
7) On the "Archive Options" screen, uncheck both "archive" checkboxes, click "Next".
8) On the "Deployment Plan" screen, check the "Overwrite" box for "Purchase__c". Click the "Next" button.
Expected Results:
The custom field "Handles_Title__c" should be created in the stage sandbox.
Actual Results:
Deployment fails with the error: "Must specify a non-empty label for the CustomObject"
-
- glorge
- December 09, 2009
- Like
- 0
- Continue reading or reply
Upsert Error: "unable to obtain exclusive access to this record"
Some notes on our upload process:
1. We are using multi-threading to increase upload speed.
2. We are *not* upserting the same record at the same time with multiple threads. (A given record only appears once in the batch upload process).
3. The object we are upserting to does have an Apex trigger on it - but this trigger only modifies the record being updated, so we should not run into any locking issues here.
4. The object we are upserting is included in a roll-up summary.
I'm thinking that maybe it's the parent in the roll-up summary that is being locked? Does this sound plausible?
I'll be investigating further. Just wondering if anyone else has ever run into this error...
-Greg
Message Edited by glorge on 11-12-2008 05:10 PM
-
- glorge
- November 13, 2008
- Like
- 0
- Continue reading or reply
Java Heap Error on Salesforce side?
Sorry if this is a dumb question - information on AxisFaults is quite scarce.
I'm getting the following AxisFault when upserting to Salesforce:
AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode: faultString: Java heap space faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:Java heap space at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:633) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) at javax.xml.parsers.SAXParser.parse(SAXParser.java:375) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.atc.sforce.stubs.SoapBindingStub.upsert(SoapBindingStub.java:3417)
...
I'm looking at the faultCode and seeing "Server"... does that mean that this is occurring on the Salesforce side?
-
- glorge
- August 23, 2008
- Like
- 0
- Continue reading or reply
Error in Migration Tool documentation?
<—xml version="1.0" encoding="UTF-8"–> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <member>Case.EngineeringReqNumber__c</member> <name>CustomField</name> </types> <types> <member>Account</member> <name>CustomObject</name> </types> <version>13.0</version> </Package>
However, I think the "member" tags should be pluralized:
<—xml version="1.0" encoding="UTF-8"–> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>Case.EngineeringReqNumber__c</members> <name>CustomField</name> </types> <types> <members>Account</members> <name>CustomObject</name> </types> <version>13.0</version> </Package>
This actually took me a bit of time to figure out - so I'm hoping I can save someone else some time by posting here (or else get it corrected).
-
- glorge
- August 09, 2008
- Like
- 0
- Continue reading or reply
How to deploy Documents with Force.com IDE
Hello,
I'm currently attempting to create/deploy a new Home Page Component (and eventually a new Home Page Layout) via the Force.com IDE. This home page will simply consist of a custom splash image that we will present to users logging into our Customer Portal.
The steps I'm trying to perform are:
1) Create a new Document (image file) via the Force.com IDE
2) Reference that image file in a new Home Page Component
3) Reference that Home Page Component in a new Home Page Layout
However, I am stuck on step 1. I can't figure out how to upload a new Document with the Force.com IDE.
I did find this thread from 2008 which says "Documents are a bit esoteric in the Metadata API. We will post a How To on developer.force.com early next week, plus we've got some exciting ideas planned for our next major release which will simplify this. Stay tuned." However, I was unable to find any How-Tos on the subject.
Is it possible to upload a Document via the Force.com IDE?
If not - would it be possible to reference a Static Resource from a Home Page Component instead? Or perhaps someone could recommend a better solution for automated deployment of Home Pages?
Thanks,
Greg
-
- glorge
- January 12, 2010
- Like
- 1
- Continue reading or reply
BUG: Force.com Migration Tool - "Cannot rename standard profile"
I'm trying to move a custom field from one sandbox into another using the Force.com Migration Tool, and getting a funky "Cannot rename standard profile" error.
Here's my package file which goes in the "$PROJECT_ROOT/unpackaged" folder:
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>*</members> <name>Profile</name> </types> <types> <members>Account.Test__c</members> <name>CustomField</name> </types> <version>18.0</version> </Package>
Here's my ant build.xml file which sits in the $PROJECT_ROOT folder:
<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="." xmlns:sf="antlib:com.salesforce"> <property file="build.properties"/> <property environment="env"/> <target name="retrieveUnpackaged"> <mkdir dir="retrieveUnpackaged"/> <sf:retrieve username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" retrieveTarget="retrieveUnpackaged" unpackaged="unpackaged/package.xml"/> </target> <target name="deployUnpackaged"> <sf:deploy username="${sf.deploy.username}" password="${sf.deploy.password}" serverurl="${sf.deploy.serverurl}" deployRoot="retrieveUnpackaged"/> </target> </project>
This properties file all goes in the $PROJECT_ROOT folder:
# build.properties # sf.username = <username>@<org>.sandbox1 sf.password = <password> sf.serverurl = https://test.salesforce.com sf.deploy.username = <username>@<org>.sandbox2 sf.deploy.password = <password> sf.deploy.serverurl= https://test.salesforce.com
To run, execute the following two commands:
ant retrieveUnpackaged ant deployUnpackged
When I try to deploy to the second sandbox I am getting the following error:
Error: profiles/Guest License User.profile(Guest License User):Cannot rename standard profile
My package is pretty straightforward and I can't imagine what I might be doing to get this error. Any thoughts?
Thanks,
Greg
- glorge
- May 13, 2010
- Like
- 0
- Continue reading or reply
Test Code Coverage for classes generated by wsdl2java
Another question on callouts.
I have stubs generate by WSDL to java. Do I need to get code coverage on these?
If so, I would think that the only way to do it would be to edit them and put in a testMode flag and conditionally not WebServiceCallout.invoke() call when that's set. Then set the testMode flag in a test method.
Is that something that I'm going to have to do or is there another work-around?
The generated code is shown below (URLS obscured for security reasons. I take it I have to hack this to get coverage on all the line except the WebServiceCallout.invoke()???
public class HMHEaiOtsCustomerGetcustomer { public class SOAPEventSource { public String endpoint_x = 'http:urldeleted'; public Map<String,String> inputHttpHeaders_x; public Map<String,String> outputHttpHeaders_x; public String clientCertName_x; public String clientCert_x; public String clientCertPasswd_x; public Integer timeout_x; private String[] ns_map_type_info = new String[]{'http://www.foobar/getCustomerDetailImpl', 'HMHEaiOtsCustomerGetcustomer', 'http://foobar/Customer', 'HMHEaiOtsCustomer', 'http://foobar/EAI', 'HMHEai', 'http://foobar/EAI/OTS/Material', 'HMHEaiOtsMaterial'}; public HMHEaiOtsCustomer.customerDetail_element[] getCustomerDetail(HMHEaiOtsCustomer.customerKey_element[] customerKey) { HMHEaiOtsCustomer.customerKeyList_element request_x = new HMHEaiOtsCustomer.customerKeyList_element(); HMHEaiOtsCustomer.customerDetailList_element response_x; request_x.customerKey = customerKey; Map<String, HMHEaiOtsCustomer.customerDetailList_element> response_map_x = new Map<String, HMHEaiOtsCustomer.customerDetailList_element>(); response_map_x.put('response_x', response_x); WebServiceCallout.invoke( this, request_x, response_map_x, new String[]{endpoint_x, '/BusinessProcesses/Customer/GetCustomerDetail/MainProcesses/getCustomerDetail', 'http://foobar.com/Customer', 'customerKeyList', 'http://foobar.comCustomer', 'customerDetailList', 'HMHEaiOtsCustomer.customerDetailList_element'} ); response_x = response_map_x.get('response_x'); return response_x.customerDetail; } } }
- Ken_Koellner
- May 13, 2010
- Like
- 0
- Continue reading or reply
BUG: Error referencing SelectOption object in Visualforce Function
I am getting an error when trying to reference a SelectObject component inside of a Visualforce function. The following code sample, which attempts to set the default value in a dropdown based on an input parameter, demonstrates the issue.
Visualforce Page:
<apex:page controller="Bug">
<form action="{!$Page.bug}">
<select name="selected">
<apex:repeat value="{!selectOptions}" var="o">
<option value="{!o.value}" {!IF(o.value = selected, 'selected', '')}>
{!o.label}
</option>
</apex:repeat>
</select>
<input type="submit" value="Go!"/>
</form></apex:page>
Controller Class:
public class Bug {
public List<SelectOption> selectOptions {get; set;}
public String selected {get; set;}
public Bug()
{
selectOptions = new List<SelectOption>();
selectOptions.add(new SelectOption('S1', 'Select One'));
selectOptions.add(new SelectOption('S2', 'Select Two'));
selectOptions.add(new SelectOption('S3', 'Select Three'));
selected = ApexPages.currentPage().getParameters().get('selected');
}
}
I get the following error when I try to compile the Visualforce page:
Save error: Incorrect parameter for function =(). Expected Object, received Text
For whatever reason, the compiler seems to be think SelectObject.getValue() returns an Object rather than a String.
Interestingly enough, when I swap out the controller with the following functionally identical controller, the Visualforce page compiles without issue:
public class Bug {
public List<CustomSelectOption> selectOptions {get; set;}
public String selected {get; set;}
public class CustomSelectOption
{
public String value {get; set;}
public String label {get; set;}
public CustomSelectOption(String value, String label)
{
this.value = value;
this.label = label;
}
}
public Bug()
{
selectOptions = new List<CustomSelectOption>();
selectOptions.add(new CustomSelectOption('S1', 'Select One'));
selectOptions.add(new CustomSelectOption('S2', 'Select Two'));
selectOptions.add(new CustomSelectOption('S3', 'Select Three'));
selected = ApexPages.currentPage().getParameters().get('selected');
}
}
Any ideas here? Obviously there is a simple workaround here - but it seems to me that the original code should have compiled just fine.
Thanks,
Greg
- glorge
- March 08, 2010
- Like
- 0
- Continue reading or reply
Force.com IDE : Cannot deploy individual Custom Field on a Custom Object
Hi All,
I just logged this issue with SF.com support. However, I figured I'd post the issue to the forum as well, to see which venue yields a better response. :)
---
I have a single Custom Field ("Handles_Title__c" ) on a Custom Object ("Purchase__c" ) that I would like to deploy via the Force.com IDE. However, I am getting an error "Must specify a non-empty label for the CustomObject" when I try to deploy this field.
Steps for Reproduction:
Preconditions:
I have two sandboxes, "greg" and "stage". Both sandboxes have acustom object called "Purchase__c". However, the Purchase__c object onthe "greg" sandbox has an additional field called "Handles_Title__c"that does not exist in "stage".
Steps:
1) In eclipse, go to File -> New -> Force.com Project. Create a new project pointing to the "greg" sandbox.
2) On the "Choose Initial Project Components" page, choose the"Selected metadata components" radio button, and click the "Choose..."button.
3) On the "Choose Metadata Components" page:
3.a) Expand the "objects - custom list"
3.b) Expand the "Purchase__c" list
3.c) Expand the "customfield" list
3.d) Check the box next to "Handles_Title__c"
3.e) Click the "Ok" button
4) Back on the "Choose Initial Project Contents" page, click the "Finish" button.
5) Right click the "src" folder in the newly created project. Select Force.com -> Deploy to server...
6) Enter login credentials for the "stage" sandbox, click "Next".
7) On the "Archive Options" screen, uncheck both "archive" checkboxes, click "Next".
8) On the "Deployment Plan" screen, check the "Overwrite" box for "Purchase__c". Click the "Next" button.
Expected Results:
The custom field "Handles_Title__c" should be created in the stage sandbox.
Actual Results:
Deployment fails with the error: "Must specify a non-empty label for the CustomObject"
- glorge
- December 09, 2009
- Like
- 0
- Continue reading or reply
Dependent Picklist in visualforce pages
I've 2 picklists, A & B, B picklist has A set as Controlling fields, now these two fields are not behing as dependent fields in my VF page :(. I wasn to display B values based on the selection on A picklist.
The dependent Picklists have been Set appropriately in Object. But when I use them in VF page the values just do not change, bit the picklists show All values stored in the field, irrespective of the selected value in the controlling field.
Can anyone help me here .. plz .... :(
- VarunC
- February 16, 2009
- Like
- 0
- Continue reading or reply
My Case VF Create New page is causing our Assignement rules to fail
Ok I have this code running on our Customer Portal to create a New Case:
<apex:page standardController="case" extensions="CustomerPortalNewCaseExtension" tabstyle="trouble_tickets__tab">
<apex:sectionHeader title="Trouble Tickets" subtitle="New Trouble Ticket"/>
<apex:form >
<apex:pageBlock title="New Trouble Ticket">
<apex:pageBlockButtons >
<apex:commandButton action="{!viewSuggestionSave}" value="Submit" />
<apex:commandButton action="{!viewSuggestionSaveAdd}" value="Submit & Add Attachment" />
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Trouble Ticket Details" columns="1">
<apex:inputField value="{!case.priority}" required="true"/>
<apex:outputField value="{!case.status}">
<apex:outputText ><font style="color:red">New</font></apex:outputText>
</apex:outputField>
<apex:inputField value="{!case.subject}" required="true" style="width: 400px;"/>
<apex:inputField value="{!case.description}" required="true" style="width: 700px; height: 100px;"/>
<apex:outputField value="{!case.Resolution__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockSection >
<c:CaseQuickTipsGuideComponent />
<c:CaseAttachmentsInstructions />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
with this extension:
public class CustomerPortalNewCaseExtension {
private ApexPages.StandardController controller;
private Case c;
public CustomerPortalNewCaseExtension(ApexPages.StandardController controller) {
this.controller = controller;
}
public PageReference viewSuggestionSave() {
controller.save();
c = (Case)controller.getRecord();
return new PageReference('/ui/solution/SolutionSuggestionPage?caseid=' + c.Id + '&autoredirected=1');
}
public PageReference viewSuggestionSaveAdd() {
controller.save();
c = (Case)controller.getRecord();
return new PageReference('/p/attach/NoteAttach?pid=' + c.Id + '&retURL=/ui/solution/SolutionSuggestionPage?caseid=' + c.Id + '&autoredirected=1');
}
static testMethod void testCustomerPortalNewCaseExtension() {
Case testCase = new Case();
testCase.Subject = 'Test Subject';
testCase.Priority = 'Medium';
testCase.Description = 'Test Description';
insert testCase;
ApexPages.StandardController caseController = new ApexPages.standardController(testCase);
CustomerPortalNewCaseExtension caseExt = new CustomerPortalNewCaseExtension(caseController);
PageReference theRef = caseExt.viewSuggestionSave();
System.AssertEquals('/ui/solution/SolutionSuggestionPage?autoredirected=1&caseid=' + testCase.Id,theRef.getUrl());
theRef = caseExt.viewSuggestionSaveAdd();
System.AssertEquals('/p/attach/NoteAttach?autoredirected=1&pid=' + testCase.Id + '&retURL=%2Fui%2Fsolution%2FSolutionSuggestionPage%3Fcaseid%3D' + testCase.Id,theRef.getUrl());
}
}
- MATTYBME
- January 28, 2009
- Like
- 0
- Continue reading or reply
Upsert Error: "unable to obtain exclusive access to this record"
Some notes on our upload process:
1. We are using multi-threading to increase upload speed.
2. We are *not* upserting the same record at the same time with multiple threads. (A given record only appears once in the batch upload process).
3. The object we are upserting to does have an Apex trigger on it - but this trigger only modifies the record being updated, so we should not run into any locking issues here.
4. The object we are upserting is included in a roll-up summary.
I'm thinking that maybe it's the parent in the roll-up summary that is being locked? Does this sound plausible?
I'll be investigating further. Just wondering if anyone else has ever run into this error...
-Greg
Message Edited by glorge on 11-12-2008 05:10 PM
- glorge
- November 13, 2008
- Like
- 0
- Continue reading or reply
Customer Portal and Single Sign On
- jazzieb
- October 29, 2008
- Like
- 0
- Continue reading or reply
Error in Migration Tool documentation?
<—xml version="1.0" encoding="UTF-8"–> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <member>Case.EngineeringReqNumber__c</member> <name>CustomField</name> </types> <types> <member>Account</member> <name>CustomObject</name> </types> <version>13.0</version> </Package>
However, I think the "member" tags should be pluralized:
<—xml version="1.0" encoding="UTF-8"–> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>Case.EngineeringReqNumber__c</members> <name>CustomField</name> </types> <types> <members>Account</members> <name>CustomObject</name> </types> <version>13.0</version> </Package>
This actually took me a bit of time to figure out - so I'm hoping I can save someone else some time by posting here (or else get it corrected).
- glorge
- August 09, 2008
- Like
- 0
- Continue reading or reply
what is the VisualForce control to create a drop-down menu?
- Surjendu
- May 02, 2008
- Like
- 0
- Continue reading or reply
SSO - Delegated Authentication
Anyone know the meaning of the login form fields ?
un => is the login yser name
pw => the password
startUrl ==> ???
LogoutUrl ==> where the logout in Salesforce will redirect (?)
ssoStartPage ==> ???
jse ==> ???
rememberUn ==> ????
Thanks
- ErikGEn
- October 05, 2007
- Like
- 0
- Continue reading or reply