• GoForceGo
  • NEWBIE
  • 425 Points
  • Member since 2007

  • Chatter
    Feed
  • 13
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 225
    Questions
  • 491
    Replies

I'm setting up the process-conf.xml file to set up a series of Upsert processes and can't find a Configuraton Parameter for Related Objects...

 

'sfdc.externalIdField' allows me to specify the External ID field used for data matching which in the GUI corresponds to

 

Step 2a: Choose your field to use for matching --> sfdc.externalIdField

 

Step 2b: Choose your related objects --> ???

 

 

I can't find any mention of this in any of the Data Loader documentation...

 

Any help is greatly appreciated!

 

Mike

 

 

 

 

 


Hello, I have a requirement to display a table of contacts and to allow the user to select one, and only one row from the table. I also want to use AJAX to rerender a different part of the page to display information about the selected contact when the user selects it. I have created a data table with an inputCheckbox column. I have also created an Apex class called "SelectableContact" which serves as a wrapper for each Contact, with a Boolean "selected" field. This is what I have so far:
 
The page:
 
Code:
<apex:page controller="ProcessingController" >
    <apex:detail />
        <apex:pageBlock id="contactHandlingBlock" title="Contact Handling" >
            <apex:form id="contactHandlingForm" >            
                <apex:pageBlockSection title="Similar Contacts" >
                    <apex:panelGrid columns="1" >                
                            <apex:dataTable id="simContactsTable" value="{!similarContacts}" var="simContact" cellpadding="4" border="1" >
                                <apex:column >
                                    <apex:facet name="header">Select</apex:facet>
                                    <apex:inputCheckbox id="select" value="{!simContact.selected}" onclick="deselectOther(this)" >
                                        <apex:actionSupport event="onclick" rerender="debugText" />
                                    </apex:inputCheckBox>
                                </apex:column>
                                <apex:column >
                                    <apex:facet name="header">Name</apex:facet>
                                    <apex:outputText value="{!simContact.contact.name}"/>
                                </apex:column>
                                <apex:column >
                                    <apex:facet name="header">Last Name</apex:facet>
                                    <apex:outputText value="{!simContact.contact.lastname}"/>
                                </apex:column>
                                <apex:column >
                                    <apex:facet name="header">Street Address</apex:facet>
                                    <apex:outputText value="{!simContact.contact.mailingstreet}"/>
                                </apex:column>
                                <apex:column >
                                    <apex:facet name="header">City</apex:facet>
                                    <apex:outputText value="{!simContact.contact.mailingcity}"/>
                                </apex:column>
                                <apex:column >
                                    <apex:facet name="header">State</apex:facet>
                                    <apex:outputText value="{!simContact.contact.mailingstate}"/>
                                </apex:column>
                                <apex:column >
                                    <apex:facet name="header">Email</apex:facet>
                                    <apex:outputText value="{!simContact.contact.email}"/>
                                </apex:column>
                            </apex:dataTable>
                            <apex:selectRadio id="contactOptions" value="{!selectedOption}" onclick="submit();" immediate="true" >
                                <apex:selectOption id="create" itemValue="create_new" itemLabel="Create new Contact" />
                                <apex:selectOption id="merge" itemValue="merge_with_selected" itemLabel="Merge with selected Contact" />
                            </apex:selectRadio>
                    </apex:panelGrid>                
                </apex:pageBlockSection>
            </apex:form>                    
        </apex:pageBlock>
        
            
    <apex:outputText id="debugText" value="{!selectedContact.name}" />
    
    <script>          
        var selectedChkbox;
        
        function deselectOther(chkBox) {
            if (chkBox.checked) {
                if ((chkBox != selectedChkbox) && (selectedChkbox != null)) {
                    selectedChkbox.checked = false;
                }
                selectedChkbox = chkBox;
            }            
        }
    </script>     
</apex:page>

 My Controller:
 
Code:
public class ProcessingController {

    List<SelectableContact> similarContacts = null;
    
    public Web_Donation__c getWebDonation() {
        Web_Donation__c webDonation = [select id, name, last_name__c, address__c, city__c, state__c, email__c 
            from web_donation__c where id = :getWebDonationId()]; 
        return webDonation;
    }
    
    /* Returns a list of contacts with same last name, or same street address and city, or same 
     * email address as the web donation object being processed
     */
    public List<SelectableContact> getSimilarContacts() {
        
        if (similarContacts == null) {
        
            similarContacts = new List<SelectableContact>();
        
            // Get the personal info from the web donation object
            Web_Donation__c webDonation = getWebDonation();
                    
            // Query for similar contacts by last name, address, email.
            List<Contact> contacts = 
                [select id, name, lastname, mailingstreet, mailingcity, mailingstate, email from contact where 
                    (lastname = :webDonation.last_name__c) or 
                    ((contact.mailingstreet = :webDonation.address__c) and 
                     (contact.mailingcity = :webDonation.city__c) and 
                     (contact.mailingstate = :webDonation.state__c)) or
                    (contact.email = :webDonation.email__c)];        
         
            // Build the list of similar contacts           
            for (Contact contact : contacts) {
                SelectableContact similarContact = new SelectableContact(contact);
                similarContacts.add(similarContact);
            }
        }        
        return similarContacts;
    }

    public void setSimilarContacts(List<SelectableContact> s) {
        similarContacts = s;
    }

    /*
     * Returns the selected Contact
     */
    public Contact getSelectedContact() {
        Contact selectedContact = null;
        if (similarContacts != null) {
         
             for (SelectableContact similarContact : similarContacts) {
                 if (similarContact.getSelected()) {
                     selectedContact = similarContact.getContact();
                 }
             }           
        }
        return selectedContact;
    }    
}

 
The SelectableContact class:
 
Code:
public class SelectableContact {

    private boolean selected = false;
    private Contact contact = null;
    
    public SelectableContact() {
    }
    
    public SelectableContact(Contact c) {
        contact = c;
    }
    
    public Contact getContact() {
        return contact;
    }
    
    public void setContact(Contact c) {
        contact = c;
    }
    
    public boolean getSelected() {
        return selected;
    }
    
    public void setSelected(boolean s) {
        selected = s;
    }    
}

 
For now, all I am trying to do is display the name of the selected contact in the outputText component with the ID "debugText". I've attached an actionSupport component to the inputCheckbox and rerender the debugText component when the checkbox is clicked. The Javascript function handles single-row selection. However, I am not seeing the selected contact name. I suspect this is because the data table does not get submitted back to the controller, and therefore the List<SelectableContact> is not updated with the selection. Anyone have a suggestion as to how to tackle this problem? Thanks in advance.
  • July 02, 2008
  • Like
  • 0
I am trying to implement my own email-to-case class and I have the following code, which is working in my sandbox, to create an EmailMessage on a case using email services:
 
EmailMessage[] newEmail = new EmailMessage[0];
 
newEmail.add(new EmailMessage(FromAddress = email.fromAddress,
FromName = email.fromName,
ToAddress = email.toAddresses[0],
Subject = email.subject,
TextBody = email.plainTextBody,
HtmlBody = email.htmlBody,
ParentId = newCase[0].Id, 
ActivityId = newTask[0].Id));   // (newCase and newTask are the newly created case and task from earlier code)
 
insert newEmail;
 
I have several questions.  Is it possible to set the email message status to "New"?  If I attempt to add "Status = 'New'" in the .add() method I get an error: Message: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Status: bad value for restricted picklist field: New: [Status] null.  If I don't attempt to set the status, it defaults to "Sent".
 
Also, does anyone have any sample code to share that adds headers and attachments from an inbound email to an Email Message object?  I'm struggling with that one.
 
Another minor issue that is bugging me is that in the Email Section of the Case page in my sandbox, the column labelled "Email Address" shows the 'to address' and my production version using the the standard SFDC email to case application will have the 'from address' (contact's address) displayed.  Does anyone know what field in the Email Message object this data comes from?
 
Thanks for the help!
I have a multi-select country picklist with 150 entries. I want to know if the value of the field includes one of the 141 countries (let's call this Group 1). Note that the user might include values from the Group 2 countries as well. I can't write a big formula (INCLUDES(field,country1) || includes(field, country2) .....INCLUDES(field, country141)).

There is no ability to convert a multi-select picklist to a text value - If I could convert the picklist to a text value, I could use the SUBSTITUTE where there the 9 Group 2 country values and ";" are substituted by blank. If the remaining string is non-empty, I know I have a Group1 value exists.

Any other thoughts before I create a "tracking field" which is a text field and copies the multi-select field via a trigger? Even with that, I will have to assume the tracking field does not exceed 255 characters, it can't be a long text field either.

Any additional thoughts?


 

Since salesforce.com does not have native Excel processing libraries, a part of my app that processes Excel will be hosted on Heroku.
These Excels are typically loaded into the system by Guest (Sites) users without a username/password, so they don't have a secure session Id associated with them.

Currently I am thinking that admin user will login and schedule an apex job into which inject a session id of the admin login . This session id would be sent via https/ssl to Heroku Excel processer. The Heroku Excel processor which would use the session id for call back to salesforce (to grab the Excel and process data in it). The Heroku app would be stateless - it  would not store anything inside database on the Heroku end - essentially it would grab excel from salesforce, process them, and put data back in salesforce.com. It would be single multi-threaded single instance of Heroku app would serve all my salesforce customers.

I am worried that session would be a long living session - it could be months, creating a risk for session highjacking.

Any other alternatives I should consider? OAuth? Seems like I would have to Oauth tokens on Heroku side in db.







 

1. I have workflow rule 1 which sets the recordType to 'Accepted'. It also set another field called Promise Date with "re-evalue workflow rules after field change" checked.
2. I have workflow rule 2 which fires under the formula !ISBLANK(Promise_Date__c) && RecordType.Name != 'Accepted'.
3. When Workflow rule 1 fires, workflow rule 2 also fires - it should not, since RecordType = 'Accepted'.
4. If I change the condition of Workflow 2 to say !ISBLANK(Promise_Date_c) && RecordTypeId != '012i00000005EuX' - substituting the ID of  recordType Accepted, everything works fine - Workflow 2 does NOT fire anymore.
5. To double check that I have not made a mistake anywhere, when I set the condition to !ISBLANK(Promise_Date__c) && RecordType.Name != 'New', Workflow 2 does NOT fire - so salesforce is picking up the ORIGINAL RecordType.Name  which is 'New'. However for RecordTypeID, it is picking up a the UPDATED recordTypeId

It appears to be a bug to me somewhere in salesforce....????


It appears to be a bug to me....



 
I have a visualforce sites form. When the visitor clicks the submit button, I save the information in the database and then redirect the user to a landing page (e.g www.example.com). I would like to ideally display a "Thank you" page for 5 seconds that confirms that the form was submitted before doing the redirect.
 
VF Page:

             <apex:pageBlockButtons > 
                <apex:commandButton action="{!Submit}" value = "Submit" />  
            </apex:pageBlockButtons>

    
Apex Code;

public pagereference Submit() { 
         
   //save to db code first
   //redirect now 
   landingPage = new PageReference('http://www.example.com');
   landingPage.setRedirect(true);
   return landingPage;

}


 
The following code only shows Error 2. How can one modify it to show both errors (short of accumulating all errors and showing as one large string).

trigger testAccountError on Account (after insert) {


        for (Accout a: Trigger.New) {
            a.addError('Error 1');
            a.addError('Error 2');
        }

}
I have two different strings as below. In apex code, salesforce.com says the these two strings are different - they indeed are - the comma are different - they regular (U+002C) and full space (U+FF0C) unicode commas. However, when I use the same strings as external id, salesforce complains of duplicate external ids.

String s1 = 'Tongling Nongferrous Metals Group Holdings Co., Ltd.';
String s2 = 'Tongling Nongferrous Metals Group Holdings Co., Ltd.';
boolean same = s1==s2;
System.Debug('Same is ' + same);

I put the string in quotes etc, none of that helps. Any known workarounds? Anyone knows what characters salesforce.com treats as equivalent?




I am loading an excel spreadsheet through API into an object in salesforce. I have validation rules on this object.
When I get back errors on creation of this object, the validation rules seem to be in alphabetical order of field names.

Is there a way of controlling the validation rules sequence so that I can get back the first field in the spreadsheet as the first error?

I have workflow rule that fires, updates some due dates (e.g today + 30 days) and send out an e-mail alert that includes the due date. The workflow rule documentation say that field updates are evaluated before other actions (http://login.salesforce.com/help/doc/en/workflow_rules_considerations.htm)

 

1. When I use a visualforce e-mail template, the due dates are NOT populated in the e-mail send out. When I test the VF template using  "Send Test and Verify Merge Fields", it works perfect - so my merge field syntax for the due dates is okay. 

2. When I use a non-VF e-mail template, the due date merge field is populated correctly.

3. I worked around the issue by having two workflow rules - the first one that sets the due dates and checked "Re-evaluate Workflow Rules after Field Change". The second workflow rule fires when due date is set and hence fires in sequence.  

 

So, is something going on with order of execution when VF templates are used?

 

 

 

I have a VF table in which one of the columns is "Show Activity History". In each row, that is a hyperlink in this column called "View All" meant to show activity history.


When the end user clicks "View All", I want to insert the activity history in-line below the current row - before the next row.. Of course the row hyperlink would then say "Hide All".

 

Any ideas?

 

 

 

I have a Sites VF page. Whenever there is a bug in the code leading to a crash, the end user gets "Down for Maintenance" message which is  confusing to say the least.

 

I thought I could change this message by modifying the settings as described at . http://login.salesforce.com/help/doc/en/sites_error_pages.htm

 

I set the "Maintenance Page(500/503)" and "Generic Error Page" to a custom page I created , but I still see the "Down For Mainenance".

 

 

Any ideas?

 

 

Uploading documents DIRECTLY to S3 in a secure fashion is easy: Amazon S3 supports uploading the documents directly to S3 via HTTP POST as described in http://wiki.apexdevnet.com/page/Using_Force_for_Amazon_Web_Services.  This also allows for large attachments to be sent directly to S3 without involving salesforce as intermediary.

 

However, I am wondering how one would get the documents directly to the browser in a secure fashion. I don't want the document to first be brought to salesforce.com servers - besides the overhead, SFDC supports only 3 MB for a  Web Service request size. Amazon S3 supports Query String Request Authentication (adding the amazon username(key) and signed password (signature) directly as a URL parameter. However the problem with this approach is that the URL can be copied by anyone and they can then directly access the document. I can add an expiration time as a URL parameter, but even then this is an insecure method, since someone can access the document for a few seconds.

 

Any thoughts?

 

 

 

 

	//preq already exists with pending approval status
	Custom_Obj__c pr = [select Status__c from Custom_Obj__c where id = :preq.id];
        System.ASSERT(pr.Status__c == 'Pending Approval'); 
        Test.setCurrentPage(new PageReference('/apex/customObjpage'));
        ApexPages.currentPage().getParameters().put('id',preq.id); 
        stdController = new ApexPages.StandardController(preq);
        customObjController controller = new customObjController(stdController);
        System.ASSERT(controller.customObj.Status__c == 'Pending Approval'); //fails

The status__c field is included in the customObjPage. The status is Pending Approval, but the assert at the end fails. All fields referenced in VF page are supposed to be loaded?

 

 

 

CustomObject__History[] histories = [Select Id, CreatedDate, CreatedBy.user_id__c, Field, OldValue, NewValue FROM CustomObject__c 

 

In Apex query, the system does not recognize the CUSTOM field on user called user_id and gives an error: No such column 'user_id__c' on entity 'Name'.

 

If I change it to SOME standard field like CreatedBy.Name, CreatedBy.Email or CreatedBy.UserName it works. It does NOT work for some standard fields such as Department, CommunityNickName etc.  At first it appeared that it doesn't work for Nillable fields, but it works for FirstName and Title which is Nillable!

 

I am logged in as system admin and have all fields visible.

 

 

 

 

 

 

 

 

This doesn't work. Any ideas?

 

COb__c c = [select Parent__r.Name fro Cobj__c limit 1];


String parentName = c.get('Parent__r.Name');

 

 

I am trying to filter out list views that have more than 10K records.

 

When I ask setController.getCompleteResult(), it returns true. However, when I cycle through the records (using  a while loop with getRecords(), .next(), and getHasNext()), I count till 10K and then it exits the loop! So there are more than 10K records in the set.

 

 

 

 

 

 

 

When I use outputField, the title (hover) does not show.

If I change it to outputText, it does show.

 

The documentation allows for titles on outputField.

I have Object X with field foo. I have field history tracking turned on and I am tracking history of foo__c.

 

I would like to get a record set which has the LAST CHANGE to foo across all instances of X - i.e (XId, LastFooValue, LastUpdateTime,LastUpdatedBy>. . Is there a way of doing it using SOQL WITHOUT writing any code? Note that I need this query for data loader export, which has it's limitations as mentioned below.

 

X_History[] hist = [select Parent.Name, NewValue,CreatedDate,CreatedBy.Name from X_History where Field = 'foo__c'] => if there are 3 changes for a specific record, I get three entries. The history table supports GROUP BY  ParentId, but not NewValue. Even if it did, I can't get the latest <NewValue,CreatedDate> using Max function. I could get Max(CreatedDate), but not the NewValue asssociated with Max(CreatedDate)

X__c[] Xhist = [select Name, (select NewValue,CreatedDate CreatedBy.Name from Histories where Field = 'foo__c' ORDER By CreatedDate DESC Limit 1) from X__c] => returns all X records, including those  that have NO change to foo.  Besides, I need this for dataloader export. Nested queries NOT supported by dataloader export. 

 

 

 

 

 

 

I have a Extension Controller pages where a user go through a 3 step form. On 4th step they  review and submit the form.

 

On page 1, I ask them to select a lookup field called department. I create a new record when they go to page 2. On Page 4 (review and submit), I show them the department using department__r.Name.

 

The department name shows up as empty on page 4. If I do an <outputField department__c/>, I can see the name, but I don't want to do this, since this page is exposed as a sites page as well and a clickable link would error out.

 

If I directly access page 4 at this point (by just typing in the page URL inthe browser), I CAN see the department name. So it doesn't appear to be a security setting issue. The issue happens whether I access the page using sites or as a logged in Admin user.

 

I tried adding department__r.Name as a rendered = "false" on page 1. But it did not work.

 

 

. What could it be?

 

 

 

 

I have a controller extension and a VF page X that binds to it. This Page X displays all the information about the Object. On Page X, I have a custom button 'Approve/Reject' which takes me another VF page Y that binds to same controller extension (i.e there is no redirect).

 

Now I am writing a separate "Items To Approve" page Z that has a Approve/Reject link. I would like the take the user directly to Page Y.  I am running into following issues:

 

1.  When I directly go to Page Y, I get the error "...SOQL without querying the requested field". Essentially it is complaining that fields that are referenced on Page X have not been loaded - that's how controller extensions work.

2. I tried action = "{!redirectToApprovalPage}" on Page X. Essentially on load, if "gotoapproval=true", I want to redirect to the approval page.  However, it doesn't redirect - I get to Page X - less any salesforce styling.

3. In #2, if I say page.setReDirect(true), I loose all the state

 

Any thoughts?

 

 

I have set the delegated approver (X)  for a user (Y). In User X's setting, I have set "Receive Approval Request Emails: If I am an approver or delegated approver".

 

I don't see any notification sent to X. When X logs in, they can approve/reject. When X logs in, when they go to their Activity Reports->"My Delegated Approval Requests", the request does not show. It doesn't show when I log in as Y either.

 

What's going on?

 

 

 

I have a multi-select country picklist with 150 entries. I want to know if the value of the field includes one of the 141 countries (let's call this Group 1). Note that the user might include values from the Group 2 countries as well. I can't write a big formula (INCLUDES(field,country1) || includes(field, country2) .....INCLUDES(field, country141)).

There is no ability to convert a multi-select picklist to a text value - If I could convert the picklist to a text value, I could use the SUBSTITUTE where there the 9 Group 2 country values and ";" are substituted by blank. If the remaining string is non-empty, I know I have a Group1 value exists.

Any other thoughts before I create a "tracking field" which is a text field and copies the multi-select field via a trigger? Even with that, I will have to assume the tracking field does not exceed 255 characters, it can't be a long text field either.

Any additional thoughts?


 
The following code only shows Error 2. How can one modify it to show both errors (short of accumulating all errors and showing as one large string).

trigger testAccountError on Account (after insert) {


        for (Accout a: Trigger.New) {
            a.addError('Error 1');
            a.addError('Error 2');
        }

}

 

Uploading documents DIRECTLY to S3 in a secure fashion is easy: Amazon S3 supports uploading the documents directly to S3 via HTTP POST as described in http://wiki.apexdevnet.com/page/Using_Force_for_Amazon_Web_Services.  This also allows for large attachments to be sent directly to S3 without involving salesforce as intermediary.

 

However, I am wondering how one would get the documents directly to the browser in a secure fashion. I don't want the document to first be brought to salesforce.com servers - besides the overhead, SFDC supports only 3 MB for a  Web Service request size. Amazon S3 supports Query String Request Authentication (adding the amazon username(key) and signed password (signature) directly as a URL parameter. However the problem with this approach is that the URL can be copied by anyone and they can then directly access the document. I can add an expiration time as a URL parameter, but even then this is an insecure method, since someone can access the document for a few seconds.

 

Any thoughts?

 

 

 

 

I am getting ready to launch a product and I am scratching my head on this one as to how I would go about packaging (managed versus unmanaged) it for my clients.

Here is my understanding of Managed versus unManaged package:

Managed:


1. Clients don't see my code - my IP is protected
2. Once I publish the managed package as released, my engineering won't be able to modify a lot of things - such  objects and object attributes in the developer environment. This is clearly undesirable for a startup.
3. Once I create a managed package in a developer environment, my object get prefixed with the unique prefix - even if i delete the managed package, objects retain their prefix.
4. Clients can upgrade without uninstall...
5. Managed beta package is an not an option, since it can't be done in production environment - only sandbox or developer. I am looking for real production customers who will pay me, but appreciate the fact that product might change based on their feedback.

UnManaged:

1. Code is visible to my clients - my IP is unprotected
2. I can freely modify my product in developer environment, downside being that customers have to uninstall the prior release and manually reimport all the data.

Ideally I want a managed package (to protech my IP and enable  upgrades). However, I  find the prospect of my engineering  not being able to modify the  objects for eternity a  little scary. I understand this is important so that clients can upgrade, but since my product will evolve, I don't want to be locked in early on. Early clients might be willing to uninstall and reimport, if they see newer functionality is worth it.

One option I was thinking was to always maintain an unpackaged version as my golden source code. I can then use this to create multiple managed packages, each in a different developer enviroment, each with a different prefix. So let's say I create release 1 with a prefix "mycom1". My first client installs this - the objects are called mycom1__abc etc...If my client finds bugs, I fix them in the mycom1 and also in my golden source (yucks!). Let's say that I find that I do have to modify my objects. I go back to my golden source and and create a new managed package with prefix  "mycom2". I can give this to customer 2....Now I have to fix bugs in three places(really yucks!!!)

Does anyone have any better ideas or is my understanding flawed (I hope so).

I wish I could put beta managed packages in a production environment - I will have best of both worlds in that case!!!




1. I have workflow rule 1 which sets the recordType to 'Accepted'. It also set another field called Promise Date with "re-evalue workflow rules after field change" checked.
2. I have workflow rule 2 which fires under the formula !ISBLANK(Promise_Date__c) && RecordType.Name != 'Accepted'.
3. When Workflow rule 1 fires, workflow rule 2 also fires - it should not, since RecordType = 'Accepted'.
4. If I change the condition of Workflow 2 to say !ISBLANK(Promise_Date_c) && RecordTypeId != '012i00000005EuX' - substituting the ID of  recordType Accepted, everything works fine - Workflow 2 does NOT fire anymore.
5. To double check that I have not made a mistake anywhere, when I set the condition to !ISBLANK(Promise_Date__c) && RecordType.Name != 'New', Workflow 2 does NOT fire - so salesforce is picking up the ORIGINAL RecordType.Name  which is 'New'. However for RecordTypeID, it is picking up a the UPDATED recordTypeId

It appears to be a bug to me somewhere in salesforce....????


It appears to be a bug to me....



 
I have a visualforce sites form. When the visitor clicks the submit button, I save the information in the database and then redirect the user to a landing page (e.g www.example.com). I would like to ideally display a "Thank you" page for 5 seconds that confirms that the form was submitted before doing the redirect.
 
VF Page:

             <apex:pageBlockButtons > 
                <apex:commandButton action="{!Submit}" value = "Submit" />  
            </apex:pageBlockButtons>

    
Apex Code;

public pagereference Submit() { 
         
   //save to db code first
   //redirect now 
   landingPage = new PageReference('http://www.example.com');
   landingPage.setRedirect(true);
   return landingPage;

}


 
I have two different strings as below. In apex code, salesforce.com says the these two strings are different - they indeed are - the comma are different - they regular (U+002C) and full space (U+FF0C) unicode commas. However, when I use the same strings as external id, salesforce complains of duplicate external ids.

String s1 = 'Tongling Nongferrous Metals Group Holdings Co., Ltd.';
String s2 = 'Tongling Nongferrous Metals Group Holdings Co., Ltd.';
boolean same = s1==s2;
System.Debug('Same is ' + same);

I put the string in quotes etc, none of that helps. Any known workarounds? Anyone knows what characters salesforce.com treats as equivalent?


 

I have a Sites VF page. Whenever there is a bug in the code leading to a crash, the end user gets "Down for Maintenance" message which is  confusing to say the least.

 

I thought I could change this message by modifying the settings as described at . http://login.salesforce.com/help/doc/en/sites_error_pages.htm

 

I set the "Maintenance Page(500/503)" and "Generic Error Page" to a custom page I created , but I still see the "Down For Mainenance".

 

 

Any ideas?

 

	//preq already exists with pending approval status
	Custom_Obj__c pr = [select Status__c from Custom_Obj__c where id = :preq.id];
        System.ASSERT(pr.Status__c == 'Pending Approval'); 
        Test.setCurrentPage(new PageReference('/apex/customObjpage'));
        ApexPages.currentPage().getParameters().put('id',preq.id); 
        stdController = new ApexPages.StandardController(preq);
        customObjController controller = new customObjController(stdController);
        System.ASSERT(controller.customObj.Status__c == 'Pending Approval'); //fails

The status__c field is included in the customObjPage. The status is Pending Approval, but the assert at the end fails. All fields referenced in VF page are supposed to be loaded?

 

 

 

CustomObject__History[] histories = [Select Id, CreatedDate, CreatedBy.user_id__c, Field, OldValue, NewValue FROM CustomObject__c 

 

In Apex query, the system does not recognize the CUSTOM field on user called user_id and gives an error: No such column 'user_id__c' on entity 'Name'.

 

If I change it to SOME standard field like CreatedBy.Name, CreatedBy.Email or CreatedBy.UserName it works. It does NOT work for some standard fields such as Department, CommunityNickName etc.  At first it appeared that it doesn't work for Nillable fields, but it works for FirstName and Title which is Nillable!

 

I am logged in as system admin and have all fields visible.

 

 

 

 

 

 

 

 

This doesn't work. Any ideas?

 

COb__c c = [select Parent__r.Name fro Cobj__c limit 1];


String parentName = c.get('Parent__r.Name');

 

 

I am trying to filter out list views that have more than 10K records.

 

When I ask setController.getCompleteResult(), it returns true. However, when I cycle through the records (using  a while loop with getRecords(), .next(), and getHasNext()), I count till 10K and then it exits the loop! So there are more than 10K records in the set.

 

 

 

 

 

 

I have a text field on a visualforce page, and when someone types in two white spaces - as in: "test  white"- upon saving it automatically corrects it to one white space - as in: "test white". The issue is we DON'T want this to happen. Does anyone know if this is typical behavior for a text field, or maybe it's part of our settings? I didn't set up the visualforce page, so I'm not very familiar with it. I believe this is the code for the section that I'm having this issue with though. If anyone could let me know if they could see what is causing this issue, that would be great. Thank you!

 

  
    <apex:pageBlockSection title="{!IF(pageMode == 'new', 'Step 2. Specify ', '')}Matching Pattern" columns="1" rendered="{!pageMode != 'view'}">
        <apex:pageBlockSectionItem >
            <apex:outputPanel >
                <table id="filters" class="declarativeFilterTable">
                    <tr>
                        <th scope="col">&nbsp;</th>
                        <th scope="col">Type</th>
                        <th scope="col">Attribute</th>
                        <th scope="col">Value</th>
                    </tr>
                    
                    <apex:variable value="{!1}" var="index" />
                    <apex:repeat value="{!matchingPatternRules}" var="rule">
                        <tr style="{!IF(index > 5 && (ISBLANK(rule.Type__c) || LEN(rule.Type__c) < 1) && (ISBLANK(rule.Attribute__c) || LEN(rule.Attribute__c) < 1) && (ISBLANK(rule.Value__c) || LEN(rule.Value__c) < 1), 'display: none;', '')}" class="filterRow">
                            <td><span class="textBox hide">{!FLOOR(index)}.</span></td>
                            <td><apex:inputField value="{!rule.Type__c}"/></td>
                            <td><apex:inputField value="{!rule.Attribute__c}"/></td>
                            <td><apex:inputText value="{!rule.Value__c}" size="80"/></td>
                            <td>
                                <apex:outputPanel layout="none" rendered="{!index < 5}">
                                    <span id="and{!FLOOR(index)}" class="textBox">AND</span>
                                </apex:outputPanel>
                            </td>
                        </tr>
                        
                        <apex:variable var="index" value="{!index + 1}" />
                    </apex:repeat>
                </table>
 

OK, I have made extensive research on StandardSetController before implementing quite a complex page with features not supported by <apex:listView> or <apex:enhancedList>.

 

I have implemented pagination and column ordering, as well as some client-side multi-line selection and actions.

 

I have implemented dynamic read/write or readonly control line by line, depending on the Approved status of each line.

 

On this path, I have encountered the bug setting page size :

http://boards.developerforce.com/t5/Visualforce-Development/StandardSetController-setPageSize-does-not-work/td-p/202018

or here

http://boards.developerforce.com/t5/Visualforce-Development/bug-StandardSetController-or-QueryLocator-ignores-SOQL-where/td-p/99500

so I do not change page size.

 

 

I have another problem, and think I have the solution.

My StandardSetController is on a Parent/Children page, so filtered (by a where clause) to the id of the parent :

SELECT ID Rep__c STATUS_Done__c, isReadWrite__c, LastModifiedDate
FROM   CE_Line__c
WHERE  Rep__c = :repid

 

When I apply a filter in my VF page like this

<apex:panelGroup id="listViewFilterGrp">
    <apex:outputLabel value="Filter: "/>
    <apex:selectList value="{!CELines.filterID}" size="1">
        <apex:actionSupport event="onchange" action="{!updateMyLines}" rerender="table"/>
        <apex:selectOptions value="{!CELines.ListViewOptions}"/>
    </apex:selectList>
</apex:panelGroup>

and apply a filter, the 'WHERE Rep__c = : cerepid' clause gets wiped out : the returned list is filtered according to the definition of the filter, but across all RepIds !

 

Now I have spotted this person's problem with a WHERE clause being added to their Database query when filtering :

http://boards.developerforce.com/t5/Apex-Code-Development/ERROR-at-Row-1-Column-132-unexpected-token-WHERE/td-p/118177

 

This actually shows that the filter simply removes your own WHERE clause and *replaces* it with the equivalent clause from the filter.  How silly !!!  The filter clause should be *added* to my existing clause with AND, and everything would be fine.

 

Salesforce, please fix this bug to make StandardSetController filtering work on a Parent/Children page.

 

Thanks,

Rup

 

Hello -

 

I am trying to add a visualforce page to my custom object that will show the related products.

 

So my "Sales Checklist" object is housed on the opportunity, sales fills all the information out then the object is sent to a queue.

 

But to save time i want to pull in the opportunityLineItems in to the sales checklist?

 

Is this possable? I know very little visualforce.

 

This is as far as I have gotten:

 

<apex:page StandardController="Sales_Checklist__c">
<apex:relatedList list="Opportunity__r" />

<apex:pageBlock title="{!Sales_Checklist__c.Opportunity__r.Name}"/>

  <apex:dataTable value="{!Sales_Checklist__c.Opportunity__r}" var="opp" cellPadding="4" border="1">
                
           <apex:column ><apex:facet name="header">Product Name</apex:facet></apex:column>
                
                
           <apex:column><apex:facet name="header">Quantity</apex:facet></apex:column>
                
                
           <apex:column ><apex:facet name="header">Unit Price</apex:facet></apex:column>
                
              
           <apex:column ><apex:facet name="header">Total Price</apex:facet></apex:column>
  </apex:dataTable>
</apex:page>

 

 

any help would be greatlt appriciated

 

Thanks,

Niki

Hi,

 

We have a process where customers need to submitted / upload scanned documents via a force.com app

Is it possible to store the documents externally via Google Docs OR Amazon S3 services?

 

There will be 100's of jpg scanned docs per week uploaded via the application.

 

Appreciate any advise on best practice.

 

Many thanks

Matt

  • March 08, 2011
  • Like
  • 0
Hi, I'm getting this error when trying to run databaseAccountExtractProcess bean.  I've included the process-conf.xml and database-conf.xml in the source.  Would appreciate your help to fix this.Code:
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dbDataSource"
      class="org.apache.commons.dbcp.BasicDataSource"
      destroy-method="close">
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
    <property name="url" value="jdbc:oracle:thin:@BTCFINAPORA2:1521:FINprod"/>
    <property name="username" value="brian"/>
    <property name="password" value="brian"/>
</bean>
<bean id="queryAccountAll"
      class="com.salesforce.lexiloader.dao.database.DatabaseConfig"
      singleton="true">
    <property name="sqlConfig" ref="queryAccountAllSql"/>
    <property name="dataSource" ref="dbDataSource"/>
</bean>
<bean id="queryAccount"
      class="com.salesforce.lexiloader.dao.database.DatabaseConfig"
      singleton="true">
    <property name="sqlConfig" ref="queryAccountSql"/>
    <property name="dataSource" ref="dbDataSource"/>
</bean>
<bean id="insertAccount"
      class="com.salesforce.lexiloader.dao.database.DatabaseConfig"
      singleton="true">
    <property name="sqlConfig" ref="insertAccountSql"/>
    <property name="dataSource" ref="dbDataSource"/>
</bean>
<bean id="updateAccount"
      class="com.salesforce.lexiloader.dao.database.DatabaseConfig"
      singleton="true">
    <property name="sqlConfig" ref="updateAccountSql"/>
    <property name="dataSource" ref="dbDataSource"/>
</bean>
<bean id="deleteAccountAll"
      class="com.salesforce.lexiloader.dao.database.DatabaseConfig"
      singleton="true">
    <property name="sqlConfig" ref="deleteAccountAllSql"/>
    <property name="dataSource" ref="dbDataSource"/>
</bean>
<bean id="queryAccountAllSql"
      class="com.salesforce.lexiloader.dao.database.SqlConfig" singleton="true">
    <property name="sqlString">
        <value>
            SELECT ACCOUNT_NAME, BUSINESS_PHONE, SFDC_ACCOUNT_ID, ACCOUNT_EXT_ID, ANNUAL_REVENUE, LAST_UPDATED, ACCOUNT_NUMBER
            FROM TableOwner.Accounts
        </value>
    </property>
    <property name="columnNames">
        <list>
            <value>account_name</value>
            <value>business_phone</value>
            <value>sfdc_account_id</value>
            <value>account_ext_id</value>
            <value>annual_revenue</value>
            <value>last_updated</value>
            <value>account_number</value>
        </list>
    </property>
</bean>
<bean id="queryAccountSql"
      class="com.salesforce.lexiloader.dao.database.SqlConfig" singleton="true">
    <property name="sqlString">
        <value>
            SELECT ACCOUNT_NAME, BUSINESS_PHONE, ACCOUNT_EXT_ID, ANNUAL_REVENUE, LAST_UPDATED, ACCOUNT_NUMBER
            FROM TableOwner.Accounts
            WHERE LAST_UPDATED > @process.lastRunDate@
        </value>
    </property>
    <property name="columnNames">
        <list>
            <value>account_name</value>
            <value>business_phone</value>
            <value>account_ext_id</value>
            <value>annual_revenue</value>
            <value>last_updated</value>
            <value>account_number</value>
        </list>
    </property>
    <property name="sqlParams">
        <map>
            <entry key="process.lastRunDate" value="java.sql.Timestamp"/>
        </map>
    </property>
</bean>
<!--- this is for updating Customers in Oracle based on SFDC Accounts -->
<bean id="updateAccountSql"
      class="com.salesforce.lexiloader.dao.database.SqlConfig" singleton="true">
    <property name="sqlString">
        <value>
            update TableOwner.Accounts accounts
               set accounts.account_name = @account_name@,
                   accounts.business_phone = @business_phone@,
                   accounts.sfdc_account_id = @sfdc_account_id@,
                   accounts.annual_revenue = @annual_revenue@,
                   accounts.account_number = @account_number@
            where
                   accounts.ACCOUNT_EXT_ID = @account_ext_id@
        </value>
    </property>
    <property name="sqlParams">
        <map>
            <entry key="account_name"    value="java.lang.String"/>
            <entry key="business_phone"  value="java.lang.String"/>
            <entry key="sfdc_account_id" value="java.lang.String"/>
            <entry key="annual_revenue"  value="java.lang.Double"/>
            <entry key="account_ext_id"  value="java.lang.String"/>
            <entry key="account_number"  value="java.lang.String"/>
        </map>
    </property>
</bean>
<bean id="XXXinsertAccountSql"
      class="com.salesforce.lexiloader.dao.database.SqlConfig" singleton="true">
    <property name="sqlString">
        <value>
            INSERT INTO TableOwner.Accounts (
               ACCOUNT_NAME, BUSINESS_PHONE, SFDC_ACCOUNT_ID, ANNUAL_REVENUE, ACCOUNT_EXT_ID, ACCOUNT_NUMBER)
            VALUES (@account_name@, @business_phone@, @sfdc_account_id@, @annual_revenue@, @account_ext_id@, @account_number@)
        </value>
    </property>
    <property name="sqlParams">
        <map>
            <entry key="account_name"    value="java.lang.String"/>
            <entry key="business_phone"  value="java.lang.String"/>
            <entry key="sfdc_account_id" value="java.lang.String"/>
            <entry key="annual_revenue"  value="java.lang.Double"/>
            <entry key="account_ext_id"  value="java.lang.String"/>
            <entry key="account_number"  value="java.lang.String"/>
        </map>
    </property>
</bean>
<bean id="insertAccountSql"
      class="com.salesforce.lexiloader.dao.database.SqlConfig" singleton="true">
    <property name="sqlString">
        <value>
            INSERT INTO brian.sfdc_de_account (
               ID)
            VALUES (@Id@)
        </value>
    </property>
    <property name="sqlParams">
        <map>
            <entry key="Id" value="java.lang.String"/>
        </map>
    </property>
</bean>
<bean id="deleteAccountAllSql"
      class="com.salesforce.lexiloader.dao.database.SqlConfig" singleton="true">
    <property name="sqlString">
        <value>
            DELETE FROM TableOwner.Accounts
        </value>
    </property>
</bean>
</beans>

 
 
2007-04-02 11:35:10,953 INFO  [main] process.ProcessConfig getBeanFactory (ProcessConfig.java:78) - Loading process configuration from config file: C:\Program Files\salesforce.com\AppExchange Data Loader 8.0\bin\..\Conf_account\process-conf.xml
2007-04-02 11:35:11,031 INFO  [main] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions from file [C:\Program Files\salesforce.com\AppExchange Data Loader 8.0\bin\..\Conf_account\process-conf.xml]
2007-04-02 11:35:11,078 INFO  [main] core.CollectionFactory <clinit> (CollectionFactory.java:66) - JDK 1.4+ collections available
2007-04-02 11:35:11,093 INFO  [main] core.CollectionFactory <clinit> (CollectionFactory.java:71) - Commons Collections 3.x available
2007-04-02 11:35:11,187 INFO  [databaseAccountExtract] controller.Controller initConfig (Controller.java:350) - The controller config has been initialized
2007-04-02 11:35:11,203 INFO  [databaseAccountExtract] process.ProcessRunner run (ProcessRunner.java:102) - Initializing process engine
2007-04-02 11:35:11,203 INFO  [databaseAccountExtract] process.ProcessRunner run (ProcessRunner.java:105) - Loading parameters
2007-04-02 11:35:12,390 INFO  [databaseAccountExtract] process.ProcessRunner run (ProcessRunner.java:116) - Logging in to: https://www.salesforce.com
2007-04-02 11:35:13,296 INFO  [databaseAccountExtract] dao.DataAccessObjectFactory getDaoInstance (DataAccessObjectFactory.java:51) - Instantiating data access object: insertAccount of type: databaseWrite
2007-04-02 11:35:13,312 INFO  [databaseAccountExtract] xml.XmlBeanDefinitionReader loadBeanDefinitions (XmlBeanDefinitionReader.java:163) - Loading XML bean definitions from file [C:\Program Files\salesforce.com\AppExchange Data Loader 8.0\bin\..\Conf_account\database-conf.xml]
2007-04-02 11:35:13,375 INFO  [databaseAccountExtract] process.ProcessRunner run (ProcessRunner.java:121) - Checking the data access object connection
2007-04-02 11:35:14,187 INFO  [databaseAccountExtract] process.ProcessRunner run (ProcessRunner.java:126) - Setting field types
2007-04-02 11:35:15,359 INFO  [databaseAccountExtract] process.ProcessRunner run (ProcessRunner.java:130) - Setting object reference types
2007-04-02 11:35:23,312 INFO  [databaseAccountExtract] process.ProcessRunner run (ProcessRunner.java:134) - Creating Map
2007-04-02 11:35:23,312 INFO  [databaseAccountExtract] action.ActionFactory getActionInstance (ActionFactory.java:64) - Instantiating operation: extract
2007-04-02 11:35:23,328 INFO  [databaseAccountExtract] controller.Controller executeAction (Controller.java:130) - executing operation: extract
2007-04-02 11:35:27,343 FATAL [databaseAccountExtract] database.DatabaseContext setSqlParamValues (DatabaseContext.java:183) - Error getting value for SQL parameter: Id.  Please make sure that the value exists in the configuration file or is passed in.  Database configuration: insertAccount.
2007-04-02 11:35:27,343 INFO  [databaseAccountExtract] progress.NihilistProgressAdapter setSubTask (NihilistProgressAdapter.java:68) - Processed 500 of 126019 total records. Rate: 120000000 records per hour. Estimated time to complete: 0 minutes and 0 seconds.  There are 0 successes and 500 errors.
2007-04-02 11:35:28,343 FATAL [databaseAccountExtract] database.DatabaseContext setSqlParamValues (DatabaseContext.java:183) - Error getting value for SQL parameter: Id.  Please make sure that the value exists in the configuration file or is passed in.  Database configuration: insertAccount.