• glorge
  • NEWBIE
  • 15 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 18
    Replies

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

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;
        }
    }
}

 

 

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 

Message Edited by glorge on 03-08-2010 03:05 PM
Message Edited by glorge on 03-08-2010 03:06 PM

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" 

 

 

Message Edited by glorge on 12-08-2009 04:13 PM

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 .... :(

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());

}
}

 

 

 

I'm seeing this error relatively frequently as I attempt to upsert data to Salesforce. However, it isn't 100% repeatable - if I try to run the same batch job again it is a different set of records that fails to upsert.

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
I have set up a customer portal and now want to have Single sign on to it from our company website .. I am really struggling with this as I can see "Is SSO enabled" in a normal users profile under General User Permissions but there does not seem to be anywhere to set it in a Portal user's profile .. I've had our web developer review all the Wiki entries and it all makes perfect sense apart from the bit about "make sure the portal user profile has "Is Single-sign-on enabled" checked and you are using the correct login URLs."
 
Has anyone already set this up and could give me some direction?
 
Jaz
Looking at the Force.com Migration Guide, under Using the Force.com Migration Tool | Constructing a Project Manifest | Specifying Standard Objects, the following example code is listed to retrieve metadata for a Standard Object:

Code:
<—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:

Code:
<—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). 

what is the VisualForce control to create a drop-down menu? I dont see anything like that in the developer guide.
Hi

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