• MarioKorf
  • 0 Points
  • Member since 2008

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 42



         Am trying to move my entire code from one developer org to another developer org. We have overriden some buttons on custom objects with visualforce pages in first org. Now when am trying to move the code using eclipse, because of tab overriden, it is showing error about synchronisation. Is there any another way to move entire code?



Thanks in advance




Hi There,


I want to know how to take a sandbox backup before it get refreshed.



I'm trying to get all metadata by any way in the goal to export those metadata in the future on a new organization account.
I've tried by using Ant-saleforces with : <members>*</members> of any types but I didn't get the metadata for the leads for example.
I searched software, method on the API to get all Metadata but I did not found anything.



Fabien T.


  • July 22, 2009
  • Like
  • 0
I have a trigger that works perfect in development. It's been done for about 1 week now.

I cannot get it deployed because I cannot build the test.

Hey, I've asked for help from this forum and no help - that worked
I've poured over every scrap of documentation.

I found an example and went back to it.
This time, I'm going to make a package out of your example
So here goes ...
This is all from your documentation.
First - the Trigger
Second - the Class.
Your documentation says this is what you need.
I made a trigger and compiled it - ok.
I made the class and compiled it - ok.
Went to make a package so I can get this into  P R O D U C T I ON   -   and FAILURE !!!!!!!!!!!!!!

From your PDF - The_World's_First_On-Demand_Programming_Language

The Trigger:

trigger blockDuplicates_tgr on Lead bulk(before insert, before update) {
* begin by building a map which stores the (unique) list of leads
* being inserted/updated, using email address as the key.
Map<String, Lead> leadMap = new Map<String, Lead>();
for (Lead lead : System.Trigger.new) {
if (lead.Email != null) { // skip null emails
/* for inserts OR
* updates where the email address is changing
* check to see if the email is a duplicate of another in
* this batch, if unique, add this lead to the leadMap
if ( System.Trigger.isInsert ||
(System.Trigger.isUpdate &&
lead.Email != System.Trigger.oldMap.get(lead.Id).Email)) {

if (leadMap.containsKey(lead.Email)) {
lead.Email.addError('Another new lead has the same email address.');
} else {
leadMap.put(lead.Email, lead);

/* Using the lead map, make a single database query,
* find all the leads in the database that have the same email address as
* any of the leads being inserted/updated.
for (Lead lead : [select Email from Lead where Email IN :leadMap.KeySet()]) {
Lead newLead = leadMap.get(lead.Email);
newLead.Email.addError('A lead with this email address already exists.');

 Now : The Test Class.

public class testBlockDuplicatesLeadTrigger {

static testMethod void testDuplicateTrigger(){

Lead[] l1 =new Lead[]{
new Lead( Email='homer@fox.tv', LastName='Simpson', Company='fox' )
insert l1; // add a known lead

Lead[] l2 =new Lead[]{
new Lead( Email='homer@fox.tv', LastName='Simpson', Company='fox' )
// try to add a matching lead
try { insert l2; } catch ( System.DmlException e) {
system.assert(e.getMessage().contains('first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, A lead with this email address already exists'),

// test duplicates in the same batch
Lead[] l3 =new Lead[]{
new Lead( Email='marge@fox.tv', LastName='Simpson', Company='fox' ),
new Lead( Email='marge@fox.tv', LastName='Simpson', Company='fox' )
try { insert l3; } catch ( System.DmlException e) {
system.assert(e.getMessage().contains('first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Another new lead has the same email'),


// test update also
Lead[] lup = new Lead[]{
new Lead( Email='marge@fox.tv', LastName='Simpson', Company='fox' )
insert lup;
Lead marge = [ select id,Email from lead where Email = 'marge@fox.tv' limit 1];
marge.Email = 'homer@fox.tv';

try { update marge; } catch ( System.DmlException e) {
system.assert(e.getMessage().contains('irst error: FIELD_CUSTOM_VALIDATION_EXCEPTION, A lead with this email address already exists'),


  AGAIN : the above compiled.

With the two items above saving correctly, let's create a package.
Create a new unmanaged package and add the two items above.
Click 'upload'.


- - - Here is what it says

There are problems that prevent this package from being uploaded.

Item TypeNameProblem
Apex ClasstestBlockDuplicatesLeadTrigger.testDuplicateTrigger()System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, blockDuplicates: execution of BeforeInsert

caused by: System.NullPointerException: Attempt to de-reference a null object

Trigger.blockDuplicates: line 14, column 32
Class.testBlockDuplicatesLeadTrigger.testDuplicateTrigger: line 6, column 9

    HELLO - HOUSTON - WE HAVE A PROBLEM.  Your own example doesn't work !!!!!!!!!!!!!!!!!!!!!!

    I have spent the last 3-4 weekends on SalesForce. I've been working on this thing overtime about 3 nights a week.
    Without getting our trigger up into production - I WILL report to my management that Salesforce is a FAILURE.

    We are a LARGE account. My suggestion to executive level is
    (1) You write the test for free, or
    (2) You allow the trigger to work without a test, or
    (3) We cancel the Purchase order and look at other CRM products.

    We have called our account executive who put us in touch with a 'specialist'.

   The specialist said that you don't even use tests anymore !

    Something is going to give here.

    Can you at LEAST make your example work so that I have SOMETHING to go by.

    Time and Date: Saturday, April 19, 2008 at 4:30pm

Will you at least get your example to work?  What are we going to do.

Monday, I go to my managment and raise big alarms and declare a failure.


    I am facing problem in installing Force.com IDE for Eclipse 3.3.x .

As per steps mentioned for  Force.com IDE Installation for Eclipse 3.3.x

I am facing problem at step 3 which is

Add the Force.com IDE Remote Site:

1. Launch Eclipse, and then click Help > Software Updates > Find and Install.

2. Select "Search for new features to install" and click "Next".

3. Add the Force.com IDE Remote Site:
  • Click "New Remote Site". The New Update Site dialog opens.
  • Set the Name to "Force.com IDE" and the URL to "Link: ", then click OK.
  • Select “Europa Discovery Site” and "Automatically select mirrors”, then click “Finish”. Eclipse will search the selected sites for the required plugins.
here at "http://www.adnsandbox.com/eclipsetoolkit/release" link nothing is there except a redirection link to Force.com IDE Installation for Eclipse 3.3.x  is there

thats why Eclipse Update Manager is showing error as follow :

Network connection problems encountered during search.

  Unable to access "http://download.eclipse.org/releases/europa".
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
  Unable to access "http://www.adnsandbox.com/eclipsetoolkit/release".
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
    Error parsing site stream. [Premature end of file.]
    Premature end of file.

Can anybody help me to get Force.com paltform installed.

Thanking in advance.
  • March 18, 2008
  • Like
  • 0

Was wondering about the files under the 'profiles' folder in my Eclipse Force.com project.  Their format looks like...

<Profile xmlns="http://soap.sforce.com/2006/04/metadata">

. . .

. . .

. . .


 Now:  what I'm seeing is - these profile files contain information for ONLY objects that were created in this org via the IDE itself; i.e. permission information on objects/fields created via the GUI does not appear.

Is this the intended behaviour?  Is there a way to populate these files with ALL the field/object visibility/permission information?  Also - is there a plan to include the remaining profile-related metadata - e.g. page layouts, admin permissions - in these profile files?



  • March 12, 2008
  • Like
  • 0
I am looking to clone custom fields and be able to apply them to multiple custom objects - EXAMPLE: I want to have Field 1, 2 & 3 on custom object A, and I need anothe object (Object B) to use the same 3 fields - I know that I can recreate them individually, but then I have to manage 6 picklists Vs. 3 picklists, etc.
 I have been searching help and this board but unable to find an answer - anyone help?
I am trying to take a customer object definition defined in one dev org (A) and migrate it to another EE trial org (B)
Instead of doing a full migrate, I am just taking the xml from  A and trying to overwrite the file in B through cut-and-paste. I save
and then within a few seconds the old  file from the server (B) overwrites from changes from A. This happens no matter what i try to do - when I say save to server, it doesn't do it either...

Code folding.  Pretty please.  This is when writing larger classes.  One of my inbound email classes is around 500 lines of code, and it's starting to get cumbersome.
I don't know how many people have managed to deploy to their production environment without a single issue in Eclipse, but this process has been a nightmare for me causing me hours of completely unnecessary work, so now I'm going to take some time to write up the crap I've gone through to inform other users as well as Salesforce. Before I say anything else, though, I'd like to propose that Salesforce enable a means to directly transfer code from a sandbox to live within the Salesforce UI with the possibility of not requiring unit testing. Now, on with my story.

I wrote a trigger and a utility class and modified them directly in the sandbox environment without the use of Eclipse. I did most of the revisions in an external editor then copied/pasted those modifications into the sandbox. I performed a variety of tests to prove that my code was working properly without the use of unit tests. When I was ready to deploy my code to the live environment almost THREE WEEKS AGO, I was at a complete loss of what to do. I didn't see any buttons in the sandbox that said "move to live" or anything in the live environment that would allow me to create a trigger by editing code directly (like you can do with s-controls), so I began doing some research. I discovered two paths to deployment: the ANT tool and Eclipse. Honestly, I was opposed to having to use either route. It seemed to me that having to download third party tools to move code from the sandbox to live was a very broken process. I researched using the ANT tool, as there appeared to be more documentation provided by Salesforce for using this tool than using Eclipse, but then I saw a few posts in this community suggesting that using the ANT tool was a very tedious, error-prone process, so I went with Eclipse (version There was almost no documentation provided by Salesforce regarding the use of Eclipse--documentation that did exist for this route was exceedingly sparse and lacks any real substance or troubleshooting information.

So, I started a new Force.com project in Eclipse we'll call Foo. I entered all the credentials and made the "SOAP Endpoint" point to "https://www.salesforce.com/services/Soap/u/11.1", which is the live environment. I figured I could just paste all my code into this new project then save it to live. When the project was created, the first thing I noticed were subfolders in Foo/src that had no value to this project whatsoever; these were subfolders named "AJAX Tools", "crystalreports.com release v1.2", "Financial", and "VerticalResponse for AppExchange". I could only guess these were installed applications/packages in our Salesforce environment, but what were they doing in my project?! I figured, okay, well, this is stupid, but I'll ignore these folders and put everything beneath the "unpackaged" subfolder. I recreated my trigger and utility class, then attempted to "Synchronize with Server", "Save to Server", and "Refresh from Server", but nothing worked. A dialog would pop up saying "Operation in progress..." but then it would close without any information. Nothing was working. I did more research and figured it might have to do with the fact that I wasn't running any tests, so I created a quick testMethod and ran it. Still nothing. I went in and tweaked the project settings, changed the "SOAP Endpoint" to "https://test.salesforce.com/services/Soap/u/11.1" and modified the credentials so I could access the sandbox and magically, all of the Force.com menu options started doing something. So that's great, I thought, now I can manipulate items in the sandbox, but that doesn't achieve anything.

More research led me to trying the test unit route. I figured if I created some code to test my trigger and utility class and achieve full coverage, I'd be past one of the stages of this horrible deployment process. So, I created a new class to house my testMethods and the first testMethod I wrote was to test my utility class. Right-click, Force.com, Run Tests and voila, utility class is 100% covered--it was small, had almost no conditionals, and didn't modify any objects in Salesforce, so 100% coverage for this was trivial. Now, time to test the trigger. Developing the testMethod for this was beyond tedious, causing me days of trouble, and I had other tasks and projects to attend to at work that actually accomplished something. Ultimately, with another pair of eyes examining the test code, I discovered the error was a misplaced 'insert' line. Fortunately, all this time I was running tests, all I had to do was right click in the code of my test class, go down to Force.com, and 'Run Tests'. The test coverage status would display in a pane in the "Apex Code Test Runner" and it applied to both my trigger and my utility class. After finally achieving 100% coverage of the trigger, I attempted the first deploy. First, I was prompted about files not being synchronized so I decided to attmept a synchronization, but because of the presence of some oddities in other files beneath those extra packages, such as "Financial", full synchronization didn't seem to work, so I skipped this and continued with deployment. Second, I encountered problems with the version number, since the sandbox is running 12.0 and this would be written into the meta files for the code, but the live environment is running 11.1, so conflicts arose. Next, I was posed with a deployment plan which had all kinds of references to things associated with the other aforementioned applications, and this was yet another annoyance, but I could safely ignore these inclusions. So, I found the pieces of the plan relating to my trigger, utility class, and test class, checked them, validated deployment, and finally deployed successfully--that was fairly painless.

Then my next nightmare started: I had to change a single literal string value being assigned to a variable in my trigger, so I would have to do this then redeploy. I modified the literal string and ran tests again. This time, however, the code coverage shown in the "Apex Code Test Runner" applied to the test class itself (which makes no sense) and neither the trigger nor the utility class were mentioned. The only way I could get the test class to run against something other than itself was to right click on the "classes" subfolder (i.e. Foo/src/unpackaged/classes), which contained both the test class and utility class, then go to Force.com > Run Tests. The code coverage then showed 100% coverage for both the utility class and the test class. I decided to try a deploy without running the tests directly like this, and when I came to the deployment plan I noticed something very odd: the deployment plan had "Overwrite" options for my trigger and utility class, but they belonged to the "Financial" application and were not in the "unpackaged" category. I exited the deployment dialog and expanded the "Financial" folder and its "classes" and "triggers" subfolders which revealed copies of my utility class and trigger. Now, beneath my project, my trigger and utility class existed both beneath "Financial" and "unpackaged". I selected the copies beneath "Financial" and deleted them, a dialog appeared saying they did not exist on the server so they would only be deleted locally--wonderful. Then I went to issue another deployment. Oops, version issues, have to modify those meta files then deploy again. Came back to the deployment plan (after having to enter my credentials and select a SOAP Endpoint for the deployment for the umpteenth time) and found my trigger and utility class marked for deletion from the Financial package, but there was no mention of "Adding" or "Overwriting" for my trigger and utility class under the "unpackaged" package. So, I ran the deploy, deleted the faux trigger and utility class from "Financial" and attempted to deploy again hoping the plan would display my classes under the "unpackaged"--nothing. Where the hell did they go?

I created another project, pasted my code, attempted to run tests but saw my test class was receiving 100% coverage with no mention of my trigger or utility class, so that's still broken, but I issued a deploy, anyway. Deploy failed saying my trigger was only 35% covered. I examined the test code and discovered a line I must have commented out somewhere in the confusion, then deployed, again. Finally, almost three weeks later, 100% coverage, successful validation, successful deployment.

I shouldn't have to massage a third party IDE to deploy something from the sandbox to live, but I did and needless to say, I'm beyond frustrated.

Message Edited by soma on 03-07-2008 11:54 AM
  • March 07, 2008
  • Like
  • 0
Is it possible to store query in eclipse and am not able to export query result from eclipse /sforce IDE. Thanks


I've copied my Production site to my Sandbox and working on a project which will involve creating new fields for pre-existing custom objects.

I'm hoping to avoid manually re-creating the new fields in the Production account, but don't see a way to package new fields for custom objects (only custom fields for standard objects).  Am I correct, or has someone done this successfully in the past?

Thanks, any input is appreciated.
Note: I'm sitll using the older (Oct.) version of the Eclipse plugin.  Haven't tested if this error happens w/ the new one.

With an existing scontrol, I changed one small thing (just a bit of text in the HTML, nothing that affects the functionality.)  When I tried to save, I got this error:

"Id not specified in an update call"
This doesn't make any sense to me, because:
* there are no Update calls at all in the scontrol - only Creates and Queries.
* the last time this scon was saved, it was saved just fine, and I didn't change anything of substance
Moreover, when I went in through the regular SF UI and made the exact same change to the scontrol via the UI, it saved no problem.

Is this a bug in the plugin, or is something else going on?

Thanks much!

  • February 25, 2008
  • Like
  • 0
Hello Everyone,
I am having problems getting started with eclipse. I have installed the plug-in for eclipse 3.3. When I try to create my first project I get INVALID_LOGIN: Invalid username, password, security token; or user locked out.
The security token has been reset and have appended my password to the left of the token.  The SOAP endpoint that I am using is https://www.salesforce.com/services/Soap/u/12.0
I really don't have a clue what I am missing
Would appreciate any help, suggestions.
thank you,
I have installed Force.com plugin in my eclipse.When I'm trying to create a Force.com Project an error is showing up saying 'com.salesforce.toolkit was unable to load class com.salesforce.toolkit.factories.ToolkitExtensionFactory'.
Can anyone help me in this.
Thanks in advance.
  • February 22, 2008
  • Like
  • 0
I was happily using the new IDE yesterday as I created my first Apex email service. I deployed it successfully to production and the service successfully processed inbound email.

Today, I can't deploy changes I've made. In the deployment wizard, I get a null pointer error as it's trying to develop a deployment plan.

I changed my class code, but there are no errors and the tests pass, so not sure why it would be bombing like this.

Any ideas what this might be or how to troubleshoot such an error in deployment?


I have encountered a bug when trying to deploy where it says I have not selected any components when in fact components are selected. This occurs on step 3 when using the deselect all and sorting abilities.

I usually wouldn't be so quick to call this a bug but I have been able to replicate this issue on two different machines.

Force.com IDE:
Latest version of Java.

1. Deselect All
2. Sort by Type


1. Sort by Type
2. Deselect All

3. Select a component and then hit Validate it will say, please select at least one component. Hitting Next will cause it to fail.

With that latest release of the toolkit and its ability to deploy nearly every custom object we have a list of about 200 components to sort through when deploying so not have these deselect all and sort abilities makes it a little more difficult.


Message Edited by TehNrd on 02-19-2008 02:45 PM
  • February 19, 2008
  • Like
  • 0
I haven't figured out yet how you can build a custom object in one instance and then move it to another one thru Eclipse instead of packaging it or having to rebuild it in the new instance.  Any thoughts/ideas?  Thanks.