Download the .txt file in Salesforce

In our company we receive files from the banks in .txt format, where information about each payment from a customer is stored as numbers. I want to upload this file to Salesforce, but it seems like it's not possible to upload .txt files to Salesforce

Unit tests in SalesForce

I found a similar answer here: How to unit test works in salesforce? and here: But those didn't really seem to answer my particular question. I "st

Get Variable Does Not Exist: String in Apex Method

I am getting the error "Variable does not exist: String" on the nextOne() method when calling String.fromCharArray(). I'm not sure how I'm losing scope of String or it's static methods. public with sharing class NextLetterGenerator { public List

Foreach with a select / from square brackets?

I was recently looking at wrapper classes and googled the following page... While I understood wrapper classes, I was baffled by the following... public List<cContact> getContacts() { if(contactList =

Downloading Multiple Files in Salesforce via Visualforce

I would like to upload multiple files in Salesforce using visualforce. I can upload one file at a time. But my requirement is, i want to display only one "add a file" button in visualforce page, when clicked over that button browse window should

Eclipse and Salesforce

I am working on Salesforce using the Eclipse IDE, I just want to access a simple currency converter webservice wsdl. my question is can we use the eclipse webservice client for wsdl which generat

apex: commandButton can not return anything?

I have: <apex:commandButton action="{!whatever}" value="myButton" reRender="sectionX" /> And public String whatever(){ return 'ok'; } It doesn't work (returns 401 Unauthorized), but if I write: public void whatever(){ /

Conditional rendition with a redirect

Here is the set up. I have a standard page layout with custom buttons. When the user clicks a button, i want to check a value in the extension class. If the value is null or 0- i want a pages message to appear, otherwise i want to redirect them to an

Access the Salesforce Soap Apex Web Service from Java

i'm trying to establish a Connection to my Apex-Webservice but it fails everytime. My Webserce is quite Simple: global class AtlassianService { webService static String hello(String Name) { return 'Hello '+Name+' ! :D'; } } To generate the Client i j

Clarification on governor limits for soql queries

Setup: Say I have five Contact sObjects that I create and apex. When you insert a contact one at a time, you have x soql queries by way of triggers and stuff it uses. Questions: So if you insert each contact one at a time in your code you get 5x soql

How to add a custom confirmation dialog box with Visualforce

As my Apex code show in below, when once user execute 'saveSearchItems' action with 'apex:commandButton', if result of the validation got 'false', I want to show confirmation dialog box to user message with 'Validation failed, do you want to continue

newline character in the text box

I have a custom field called Current_Address__c which is of datatype textarea. I need to populate this field in the format below. ie a newline char after street and another newline after zip. street City state Zip Country The values of city state zip

Visualforce passing the static resource URL to Apex

I am trying to pass a static resource URL, via the apex:param tag. The code I have so far is: VisualForce: <apex:selectList value="{!SelectedFamily}" onchange="renderGallery();" size="1" label="Product Family">

Organization of Apex classes under the namespace

Is there any way in Salesforce to group apex classes under a package or namespace? Can we use managed package for internal organization purpose?This is a limitation in the stack that makes medium-large size projects painful, if not impracti

Salesforce: I just reached my server's time limit

I'm a relatively new developer who uses the IDE on eclipse. What are some things I could do to avoid this happening in the future? I heard that using Eclipse might not be the efficient way of doing things in general... but I'm very used to

Prevent duplicate records in a custom object

I have a custom object. There are combination of fields like month_c,Project_c,contact_c and role_c which determine the record as unique. I can write a trigger on before insert to check if there are any records with the same combination already exist

sObject in Visualforce?

I have an apex controller which builds up a list to be displayed in a datatable. The list combines different object, so the variable I create is a List Say all the objects in this list have an "external__c" field. How do I tell the visualforce t

Run a Salesforce controller via javascript?

I know it's easily possible to execute javascript through a controller, but is it possible to do it the other way around? Use case scenario: I have a list of products on the left side of a page. When I click one of these products, I have a CSS highli

I want to expose xml / json nude on VisualForce

I am trying to expose self generated XML (or JSON) from VisualForce. However I cannot find the way to override the parent pages on an apex:page component so I am getting the whole menu, bars and all he extra html around. But I only want to serve the

Save a hash chain in Salesforce?

Not a SFDC expert but need to integrate a web form hosted in SFDC. For other reasons, this page needs to capture an initial password and send off the salted/sha256'd version of the password to another system or a human. I don't want to save the clear

How to add a custom text input field to a Salesforce Apex page?

I have a page created with a form in Apex that outputs here: I've created a new field in Leads (also in Accounts but that's moot) and am trying to call it to output a text field that someone can ente

How to implement the scheduler in Apex?

I see scheduler like feature in salesforce but it is somewhat tied with existing features that salesforce provide and no sample source code is provided as far as my research goes. What I want to do is to create my own scheduler that sends simple emai

Apex debug log output does not appear on Eclipse

I installed visualforce plugin to Eclipse 3.6 and is working fine except that system.debug does not output anything. code static testMethod void testMonth() { Month m = new Month(; system.debug('foobar'); system.debug(m.firstDate); } s